Batch Lidar DEM gridding

I'm attempting to write a script that will batch grid classified point cloud tiles to make a ground DEM (class 2).

Here's what I have so far:
GLOBAL_MAPPER_SCRIPT VERSION=1.00
UNLOAD_ALL

//Import loop looking for all filenames ending in .las
DIR_LOOP_START DIRECTORY="c:\Desktop\Summit_County\LAS\"FILENAME_MASKS="*.LAS" \
RECURSE_DIR=NO

//Import only class 2, generate elevation grid using minimum gridding algorithm (3m resolution), and export geotiff
IMPORT FILENAME="%FNAME_W_DIR%" TYPE="LIDAR_LAS" LIDAR_FILTER="NONE,2" GENERATE_ELEV_GRID GRID_ALG BIN_MIN GRID_BIN_SIZE="3.0" \

EXPORT_RASTER FILENAME="c:\Desktop\Summit County\Grids\%FNAME_WO_EXT%.TIFF" TYPE=GEOTIFF \

//Unload loaded data
UNLOAD_ALL

//End of loop
DIR_LOOP_END

I can get the loop to work in GM, but I'm not sure how to get the gridding to initiate

"Importing file C:\Desktop\Summit_County\LAZ\1565_3560_1.las...
WARNING: Unknown parameter <GENERATE_ELEV_GRID> ignored.
WARNING: Unknown parameter <BIN_MIN> ignored.
WARNING: Unknown parameter <EXPORT_RASTER> ignored.
WARNING: Duplicate parameter <FILENAME> ignored.
WARNING: Duplicate parameter <TYPE> ignored.
Importing file C:\Desktop\Summit_County\LAZ\1565_3565_1.las..."

This is my first GM script so hopefully it's not too bad! Any help is much appreciated!

Tagged:

Answers

  • bmg_bobbmg_bob Global Mapper Programmer Posts: 2,218
    What version of Global Mapper are you using?

    The best way to create an IMPORT command is to use the UI to import one of your LAS files, using the appropriate filters, etc., then create a workspace.  Open the workspace file in a text editor (a workspace is actually a script file) and copy the IMPORT statement for your file.  Since you will be using a loop, you will need to edit the FILENAME parameter so that it uses the parameter instead of the hard-coded file name, but the rest of the statement should be exactly what you need.  Note that when you import LAS data into the UI, you can tell GM to load it as an elevation grid instead of a point cloud.  If you do this, the generated IMPORT statement will include this step, and you won't need a separate GENERATE_ELEV_GRID command.

    The first message suggests that the GM script parser thinks your GENERATE_ELEV_GRID command is actually a parameter on your IMPORT command.  Make sure the IMPORT command does not end with \<newline>, which signals that the next line is a continuation of the current command.

    It appears that the GENERATE_ELEV_GRID line does end with a \<newline>, which explains the Unknown parameter <EXPORT_RASTER> message (and the ones that follow.)
  • This is v16. Thanks for the tip! The script worked. Here's what I input:

    //BATCH LIDAR GRIDDING SCRIPT

    GLOBAL_MAPPER_SCRIPT VERSION=1.00
    UNLOAD_ALL

    //Import loop looking for all filenames ending in .laz
    DIR_LOOP_START DIRECTORY="c:\Desktop\Summit_County\LAS\"FILENAME_MASKS="*.LAS" \
    RECURSE_DIR=NO

    IMPORT FILENAME="%FNAME_W_DIR%" TYPE="LIDAR_LAS" \
    LABEL_FIELD_FORCE_OVERWRITE="NO" LOAD_FLAGS="267452417,9.000,0,4~0~0~0~0~0~0~0,,4294967295,0.00,-3.00,1,-1" \
    SAMPLING_METHOD="BILINEAR" CLIP_COLLAR="NONE" ELEV_UNITS="METERS"

    EXPORT_RASTER FILENAME="c:\Desktop\Summit_County\Grids\%FNAME_WO_EXT%.TIFF" TYPE=GEOTIFF 

    //Unload loaded data
    UNLOAD_ALL

    //End of loop
    DIR_LOOP_END
Sign In or Register to comment.