Difference between revisions of "XML Script Lidar and DTM Import"

From OCAD Wiki - English
Jump to navigation Jump to search
Line 1: Line 1:
[[File:Mas40px.png|This function is available in OCAD Mapping Solution.|link=https://www.ocad.com/en/products/ocad-for-cartography]]
+
[[File:Mas40px.png|This function is available in OCAD Mapping Solution.|link=https://www.ocad.com/en/products/ocad-for-cartography]][[File:Ori40px.PNG|This function is available in OCAD Orienteering.|link=https://www.ocad.com/en/products/ocad-for-orienteering]]
  
OCAD can import Lidar data (las or laz file format) and DTM with XML Scirpt.
+
OCAD can import and process Lidar data (las or laz file format) and DTM with XML Script.
 +
 
 +
[[File:LiDARImportXML.png]]
 +
 
 +
''Huge areas can be calculated in one single step.''
  
 
==Example==
 
==Example==
This script imports laz data and create contour lines and the vegetation base map.
+
This script imports laz data and create contour lines and the vegetation base map.<br>
 +
The single tiles are calculated separately and then cropped and merged together in the end.
  
 
<PRE>
 
<PRE>

Revision as of 11:52, 3 July 2020

This function is available in OCAD Mapping Solution.This function is available in OCAD Orienteering.

OCAD can import and process Lidar data (las or laz file format) and DTM with XML Script.

LiDARImportXML.png

Huge areas can be calculated in one single step.

Example

This script imports laz data and create contour lines and the vegetation base map.
The single tiles are calculated separately and then cropped and merged together in the end.

<?xml version="1.0" encoding="ISO-8859-1"?>
<OcadScript>
  <!-- 1. step: import all laz files and create ocdDem and ocdLas tiles-->
  <File.Open>
    <File>S:\O Map ZG\Template ZG.ocd</File>
  </File.Open>
  
  <File.SaveAs>
    <File>S:\O Map ZG\1_ocdDem\ZG.ocd</File>  
  </File.SaveAs>
  
  <Dem.DemImport>
    <LasImportDummy>
      <Directory>S:\O Map ZG\0_LAZ\</Directory>  
    </LasImportDummy>
    <LasImport>
      <Directory>S:\O Map ZG\0_LAZ\</Directory>  
    </LasImport>
    
    <CreateOcdDem>
      <Enabled>true</Enabled>
      <Cellsize100>100</Cellsize100>
      <CreateVegetationBaseMap>false</CreateVegetationBaseMap>
      
      <LasDtm>
        <Enabled>true</Enabled>
        <Classification>
          <Unclassified>false</Unclassified>
          <Ground>true</Ground>
          <LowVegetation>false</LowVegetation>
          <MeanVegetation>false</MeanVegetation>
          <HighVegetation>false</HighVegetation>
          <Building>false</Building>
          <LowPoint>false</LowPoint>
          <Water>true</Water>
          <OverlapPoints>false</OverlapPoints>
          <Other>false</Other>
        </Classification>
        <ReturnType>1</ReturnType>
        <CreateAndLoadIntensityAndClassificationMap>false</CreateAndLoadIntensityAndClassificationMap>
      </LasDtm>
      
      <LasDsm>
        <Enabled>false</Enabled>
        <Classification>
          <Unclassified>false</Unclassified>
          <Ground>true</Ground>
          <LowVegetation>true</LowVegetation>
          <MeanVegetation>true</MeanVegetation>
          <HighVegetation>true</HighVegetation>
          <Building>true</Building>
          <LowPoint>true</LowPoint>
          <Water>true</Water>
          <OverlapPoints>false</OverlapPoints>
          <Other>false</Other>
        </Classification>
        <ReturnType>2</ReturnType>
        <CreateAndLoadIntensityAndClassificationMap>false</CreateAndLoadIntensityAndClassificationMap>
      </LasDsm>      
    </CreateOcdDem>  
      <CreateOcdLas>
        <Enabled>true</Enabled>
      </CreateOcdLas>
  </Dem.DemImport>
 
 <File.Save>
    <Enabled>true</Enabled>  
  </File.Save>
  <File.Close>
    <Enabled>true</Enabled>  
  </File.Close>

  <!-- 2. step: match height at tile borders-->  
  <File.Open>
    <File>S:\O Map ZG\Template ZG.ocd</File>
  </File.Open>
  <File.SaveAs>
    <File>S:\O Map ZG\2_ocdDemMatching\ZG.ocd</File>  
  </File.SaveAs>
  <Dem.MatchTiles>
    <InputFolder>S:\O Map ZG\1_ocdDem\</InputFolder>  
    <OutputFolder>S:\O Map ZG\2_ocdDemMatching\</OutputFolder>  
  </Dem.MatchTiles>
  <File.Save>
    <Enabled>true</Enabled>  
  </File.Save>
  <File.Close>
    <Enabled>true</Enabled>  
  </File.Close>

  <!-- 3. step: merge ocdDem tiles to 7000m x 7000m ocdDem tiles (5000m x 5000m + 1000m border around): -->    
  <File.Open>
    <File>S:\O Map ZG\Template ZG.ocd</File>
  </File.Open>
  <File.SaveAs>
    <File>S:\O Map ZG\3_ocdDemMerging\ZG.ocd</File>  
  </File.SaveAs>
  <Dem.MergeTiles>
    <InputFolder>S:\O Map ZG\2_ocdDemMatching\</InputFolder>  
    <OutputFolder>S:\O Map ZG\3_ocdDemMerging\</OutputFolder>  
    <TileSize>5000</TileSize>  
  </Dem.MergeTiles>
  <File.Save>
    <Enabled>true</Enabled>  
  </File.Save>
  <File.Close>
    <Enabled>true</Enabled>  
  </File.Close>

  <!-- 4. step: crop ocdDem tiles to 5000m x 5000m -->    
  <File.Open>
    <File>S:\O Map ZG\Template ZG.ocd</File>
  </File.Open>
  <File.SaveAs>
    <File>S:\O Map ZG\5_ocdDem_Cropped\ZG.ocd</File>  
  </File.SaveAs>
  <Dem.CropTiles>
    <InputFolder>S:\O Map ZG\3_ocdDemMerging\</InputFolder>  
    <OutputFolder>S:\O Map ZG\5_ocdDem_Cropped\</OutputFolder>  
    <TileSize>5000</TileSize>  
  </Dem.CropTiles>
  <File.Save>
    <Enabled>true</Enabled>  
  </File.Save>
  <File.Close>
    <Enabled>true</Enabled>  
  </File.Close>  
  
  <!-- 5. step: create contour lines -->    
  <Dem.CreateContourLines>
    <Enabled>true</Enabled>  
    <TemplateFile>S:\O Map ZG\Template ZG.ocd</TemplateFile>
    <InputFolder>S:\O Map ZG\5_ocdDem_Cropped\</InputFolder>  
    <OutputFolder>S:\O Map ZG\7_CreateContourLines\</OutputFolder>  
    <TileSizeCropping>5000</TileSizeCropping>  
    <Merging>true</Merging>  
    <EquidistanceOriginal>500</EquidistanceOriginal>
    <CreateNotSmoothedContours>false</CreateNotSmoothedContours>
    <EquidistanceLevel1>250</EquidistanceLevel1>
    <EquidistanceLevel2>1250</EquidistanceLevel2>
    <EquidistanceLevel3>0</EquidistanceLevel3>
    <SymbolNumberLevel1>101000</SymbolNumberLevel1>
    <SymbolNumberLevel2>102000</SymbolNumberLevel2>
    <SymbolNumberLevel3>0</SymbolNumberLevel3>
    <CreateSmoothedContoursUsingTpi>true</CreateSmoothedContoursUsingTpi>
    <EquidistanceTpiOriginal>250</EquidistanceTpiOriginal>
    <EquidistanceTpiLevel1>250</EquidistanceTpiLevel1>
    <EquidistanceTpiLevel2>1250</EquidistanceTpiLevel2>
    <EquidistanceTpiLevel3>0</EquidistanceTpiLevel3>
    <SymbolNumberTpiLevel1>101000</SymbolNumberTpiLevel1>
    <SymbolNumberTpiLevel2>102000</SymbolNumberTpiLevel2>
    <SymbolNumberTpiLevel3>0</SymbolNumberTpiLevel3>
    <UseDifferentSymbolsForDepressions>false</UseDifferentSymbolsForDepressions>
    <SymbolNumberLevel1Depr>0</SymbolNumberLevel1Depr>
    <SymbolNumberLevel2Depr>0</SymbolNumberLevel2Depr>
    <SymbolNumberLevel3Depr>0</SymbolNumberLevel3Depr>
    <SymbolNumberTpiLevel1Depr>0</SymbolNumberTpiLevel1Depr>
    <SymbolNumberTpiLevel2Depr>0</SymbolNumberTpiLevel2Depr>
    <SymbolNumberTpiLevel3Depr>0</SymbolNumberTpiLevel3Depr>
    <DeleteCombinedDemFile>true</DeleteCombinedDemFile>
    <MinimumContourValue>0</MinimumContourValue>
    <MaximumContourValue>0</MaximumContourValue>
    <IsMaxContourLength>false</IsMaxContourLength>
    <MaxContourLength>0</MaxContourLength>
  </Dem.CreateContourLines>

  <!-- 6. step: merge contour lines into one ocd file-->    
  <File.Open>
    <File>S:\O Map ZG\Template ZG.ocd</File>
  </File.Open>
  <File.SaveAs>
    <File>S:\O Map ZG\8_ImportAllOcds\Contour Lines.ocd</File>  
  </File.SaveAs>
  <File.Import.Ocd>
    <Directory>S:\O Map ZG\7_CreateContourLines</Directory>
    <SymbolOption>0</SymbolOption>
    <ColorOption>0</ColorOption>
  </File.Import.Ocd>  
  <File.Save>
    <Enabled>true</Enabled>  
  </File.Save>
  <File.Close>
    <Enabled>true</Enabled>  
  </File.Close>

  <!-- 7. step: create vegetation base map (png file) for each ocdLas file-->    
  <File.Open>
    <File>S:\O Map ZG\Template ZG.ocd</File>
  </File.Open>
  
  <File.SaveAs>
    <File>S:\O Map ZG\11_png\ZG.ocd</File>  
  </File.SaveAs>
  
  <Dem.CreateVegetationBaseMap>
    <Enabled>true</Enabled>
    <InputFolder>S:\O Map ZG\1_ocdDem\</InputFolder>  
    <OutputFolder>S:\O Map ZG\11_png\</OutputFolder>  
      
    <CellSize>1</CellSize>
    
    <NeighborhoodKernelUndergrowth>3</NeighborhoodKernelUndergrowth>
    <ThresholdUndergrowthLow>0.00</ThresholdUndergrowthLow>
    <ThresholdUndergrowthHigh>0.00</ThresholdUndergrowthHigh>  
    <ThresholdUndergrowthSlow>+1.00</ThresholdUndergrowthSlow>
    <ThresholdUndergrowthDifficult>+1.00</ThresholdUndergrowthDifficult>
    
    <NeighborhoodKernelVegetation>5</NeighborhoodKernelVegetation>
    <ThresholdVegetationLow>0.30</ThresholdVegetationLow>
    <ThresholdVegetationHigh>3.00</ThresholdVegetationHigh>
    
    <ThresholdVegetationSlow>-0.40</ThresholdVegetationSlow>
    <ThresholdVegetationDifficult>-0.20</ThresholdVegetationDifficult>
    <ThresholdVegetationVeryDifficult>+0.20</ThresholdVegetationVeryDifficult>
    
    <ThresholdOverlapPointsLow>0.30</ThresholdOverlapPointsLow>    
    <ShowAreaWithNoData>false</ShowAreaWithNoData>
    <UseFilter>true</UseFilter>
    <LasClassification>
      <NeverClassified>false</NeverClassified>
      <Unclassified>false</Unclassified>
      <Ground>true</Ground>
      <LowVegetation>true</LowVegetation>
      <MediumVegetation>true</MediumVegetation>
      <HighVegetation>true</HighVegetation>
      <Building>false</Building>
      <LowPoint>false</LowPoint>
      <HighPoint>false</HighPoint>
      <Water>false</Water>
      <Railroad>false</Railroad>
      <Road>false</Road>
      <Overlap>false</Overlap>
      <WireGuard>false</WireGuard>
      <WireConductor>false</WireConductor>
      <TransmissionTower>false</TransmissionTower>
      <WireStructurConnector>false</WireStructurConnector>
      <Bridge>false</Bridge>
      <Other>false</Other>  
    </LasClassification>    
  </Dem.CreateVegetationBaseMap>
  
  <File.Save>
    <Enabled>true</Enabled>  
  </File.Save>
  
  <File.Close>
    <Enabled>true</Enabled>  
  </File.Close>
  
  <!-- 7. step: merge png files to bigger tiles-->    
  <File.Open>
    <File>S:\O Map ZG\Template ZG.ocd</File>
  </File.Open>
  
  <File.SaveAs>
    <File>S:\O Map ZG\12_MergePng\ZG.ocd</File>  
  </File.SaveAs>
  
  <Dem.MergeRasterMapTiles>
    <Enabled>true</Enabled>
    <InputFolder>S:\O Map ZG\11_png\</InputFolder>  
    <OutputFolder>S:\O Map ZG\12_MergePng\</OutputFolder>  
  </Dem.MergeRasterMapTiles>

  <File.Save>
    <Enabled>true</Enabled>  
  </File.Save>
  
  <File.Close>
    <Enabled>true</Enabled>  
  </File.Close>  
</OcadScript>