Script assistance required

I am trying to create a script which will open lidar data (DEMS and LAS) tiles and create individual KML files of each tile area.  I then want it to generate contours at 0.25m intervals and export those to either DXF or DWG format with contour labels without the m or ft after for use in AutoCAD.  Further I then require it to save the contours in SHP format for use in other GIS (ESRI) products.  The following script is what I have at this stage.  I can get it to create the KML without any problem and can get it to create the contours. The script as is does not create the contours as 2d polyline as required and does not include contour labels.  I am able to do all that I require if I do each tile individually but this isn't an option as I have over 1500 square kilometres of tile to do in 1 kilometres tiles.

GLOBAL_MAPPER_SCRIPT VERSION=1.00
UNLOAD_ALL
//LOOP THROUGH ALL THE XYZ FILE
//change path for your work directory
//DIR_LOOP_START DIRECTORY="C:\_Projects\_Lidar\_Development_Code\Process_Data\" FILENAME_MASKS="*.XYZ" RECURSE_DIR=NO
      DIR_LOOP_START DIRECTORY="H:\Lidar Conversion Project\Raw Data\Zone 55\" FILENAME_MASKS="*.XYZ" RECURSE_DIR=NO
 // Import a XYZ file with Zone 56 assigned.
 //change path for your work directory and zone if applicable
// IMPORT_ASCII FILENAME="%FNAME_W_DIR%" TYPE=POINT_ONLY COORD_ORDER=X_FIRST PROJ="C:\_Projects\_Lidar\_Development_Code\Process_Data\ZONE_56.PRJ"

 IMPORT_ASCII FILENAME="%FNAME_W_DIR%" TYPE=POINT_ONLY COORD_ORDER=X_FIRST PROJ="H:\Lidar Conversion Project\Raw Data\Zone 55\ZONE_56.PRJ"
 // CREATE TIN file
 GENERATE_ELEV_GRID ELEV_UNITS=METERS GRID_ALG=TIN LAYER_DESC="%FNAME_WO_EXT%"
 UNLOAD_LAYER FILENAME="%FNAME_W_DIR%"
 GENERATE_LAYER_BOUNDS LAYER_DESC="KML"
 EXPORT_VECTOR FILENAME="%FNAME_WO_EXT%.KML" TYPE="KML" KML_AREA_DISPLAY_ABOVE_TERRAIN
 UNLOAD_LAYER FILENAME="KML"
 //GENERATE CONTOURS AT 0.25 m contours from the loaded MyTIN data.
 GENERATE_CONTOURS INTERVAL=0.25 ELEV_UNITS=METERS MULT_MINOR=1 MULT_MAJOR=4 LAYER_DESC="Contours"
 //EXPORTINGUNLOAD LAYER FILENAME="%FNAME_WO_EXT%"

 // Export the contours to a new DWG file. The created file will have
 // 3D polyline features for the contours.
 EXPORT_VECTOR FILENAME="%FNAME_WO_EXT%_0.25_CONTOURS.DWG" TYPE=DWG VERSION=R24(Autocad) GEN_PRJ_FILE=YES
 // Export the contours to a 3D shape file.
 EXPORT_VECTOR FILENAME="%FNAME_WO_EXT%_0.25_CONTOURS.SHP" TYPE=SHAPEFILE  \
     SHAPE_TYPE=LINES GEN_3D_LINES=NO GEN_PRJ_FILE=YES

 // Export the contours to a new DXF file. The created file will have
 // 2D polyline features for the contours and labels
 EXPORT_VECTOR FILENAME="%FNAME_WO_EXT%_0.25_CONTOURS.DXF" TYPE=DXF GEN_PRJ_FILE=YES EXPORT_DXF_LABELS=YES GEN_3D_LINES=NO
 UNLOAD_ALL
DIR_LOOP_END

If anyone could assist by pointing where my script is failing I would really appreciate it.


Sign In or Register to comment.