Create Elevation Grid using Python
Hello everyone,
I'm trying to create an elevation grid from a point cloud using Python in Global Mapper. I want to limit the grid to a specific polygon area feature named "BDY". In the UI, there’s an option to "Crop to selected area feature(s)", which works as expected. However, I can’t figure out how to replicate this behavior in the Python script.
The script generator always produces the same code and doesn’t include anything about using a specific area feature to crop the grid.
Could someone please advise how to specify the layer and feature (by name or attribute) to use as a boundary for creating the elevation grid?
Here’s a sample of the generated script:
elevation_grid_param = gm.GM_GridGenSetup_t()
elevation_grid_param.mBandType = gm.GM_VAL_F32
elevation_grid_param.mDesc = "Cleaned.las (DTM Elevation Values)"
elevation_grid_param.mElevUnits = gm.GM_PRJ_UNIT_METERS
elevation_grid_param.mFlags = 262242 # see GM_GridGenFlags_t32 for flag list
elevation_grid_param.mGridAlg = gm.GM_GridAlg_BinMinimum
elevation_grid_param.mGridBinMult = 5
elevation_grid_param.mLidarBreaklineBinMult = True
elevation_grid_param.mLidarField = gm.GM_LidarGrid_Elevation
elevation_grid_param.mTaperValue = 0
elevation_grid_param.mTightnessMult = 0
elevation_grid_param.mXRes = 0.5
elevation_grid_param.mYRes = 0.5
layer_arr = []
layer_arr.append( gm.FindLoadedLayer("Cleaned.las") )
err, elev_grid_layer = gm.GenerateElevationGrid2(layer_arr, elevation_grid_param)
Categories
- 12.9K All Categories
- 5.7K Features Discussion
- 346 Downloading Imagery
- 1.3K Elevation Data
- 385 Georeferencing Imagery Discussion
- 643 GM Script Language
- 54 User Scripts
- 115 GPS Features
- 419 Projection Questions
- 829 Raster Data
- 1.4K Vector Data
- 6.6K Support
- 179 Announcement and News
- 926 Bug Report
- 561 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 574 Other Discussion
- 132 GIS Data Sources
- 27 Global Mapper Showcase
- 241 How I use Global Mapper
- 108 Global Mapper Forum Website