Global Mapper v24.1

GENERATE_ELEV_GRID - Different results from script command and manual grid generating

michal
edited May 2016 in GM Script Language

Hello.

I am pretty new in Global Mapper. I have an issue with grid generated from LAS data. If I use the command in user interface, the GMG result is ok, if I use the script command the elevation values in GMG are rounded to whole meters. See my screenshots below. Is there a way how to specify same behavior of the script as in the user interface command?

Thank you for help.

Michal Becicka

Answers

  • Here is also the loop in my script which generates GMGs:

    DIR_LOOP_START DIRECTORY="%UTM_Tiles_Dir%shp_export\tiles\" FILENAME_MASKS="*.shp"

         DEFINE_VAR NAME="Tile" VALUE="%FNAME_W_DIR%" TYPE="SHAPEFILE"
         IMPORT FILENAME="%Tile%"

         EXPORT_VECTOR FILENAME="%UTM_Tiles_Dir%shp_export\points\UTM_Tilename.shp" EXPORT_LAYER="%UTM_Tiles_Dir%shp_export\points\UTM_Points.shp" LAYER_BOUNDS="%Tile%" \
     TYPE=SHAPEFILE SHAPE_TYPE=POINTS GEN_PRJ_FILE=YES OVERWRITE_EXISTING=YES
         IMPORT FILENAME="%UTM_Tiles_Dir%shp_export\points\UTM_Tilename.shp"

         DEFINE_VAR NAME="UTM_Tile" VALUE_ATTR="<Feature Name>" FILENAME="%UTM_Tiles_Dir%shp_export\points\UTM_Tilename.shp"

         //*Use of the Resolution*
         GENERATE_ELEV_GRID ELEV_UNITS=METERS SPATIAL_RES_METERS=2.0 LAYER_BOUNDS="%Tile%" LAYER_BOUNDS_EXPAND="200" LAYER_DESC="Temp_Grid"

         //*Use of the Result Name*
         EXPORT_ELEVATION FILENAME="%GMG_Directory%las2gmg_output\Ground_2M_Grid_0%UTM_Tile%.GMG" TYPE=GLOBAL_MAPPER_GRID ELEV_UNITS=METERS

         UNLOAD_LAYER FILENAME="%Tile%"
         UNLOAD_LAYER FILENAME="Temp_Grid"
         UNLOAD_LAYER FILENAME="%UTM_Tiles_Dir%shp_export\points\UTM_Tilename.shp"

    DIR_LOOP_END

  • bmg_bob
    bmg_bob Global Mapper Programmer
    Answer ✓
    Hello,

    The Global Mapper Grid format stores elevation values as whole numbers, not fractional numbers, so you should use ELEV_UNITS=CENTIMETERS (or MILLIMETERS, if you need more precision) instead of METERS.

    Cheers,

    Bob
  • Thank you for the answer.

    I was trying to use centimeters before but the result was 100x lower elevation than it should be (see the screenshot - the elevation should be from 550m to 850m not 5.5m to 8.5m). I thought I can't use the centimeters because the script loads the LAS data which are in meters and assumes that these numbers are centimeters. What I am thinking wrong about?

    Michal

  • I was playing with units and Bob is right. I just had to delete units in the command GENERATE_ELEV_GRID so now it works:

    GENERATE_ELEV_GRID SPATIAL_RES_METERS=2.0 LAYER_BOUNDS="%Tile%" LAYER_DESC="Temp_Grid"


    EXPORT_ELEVATION FILENAME="%My_grid%" TYPE=GLOBAL_MAPPER_GRID ELEV_UNITS=CENTIMETER


    Thank you.

    Michal