Dissolving areas to detect voids in rasters
We currently use a combination of GM and ArcMap to detect voids (pixel size and greater) in raster files. I am attempting to use GM scripting to eliminate the need to use ArcMap and conduct all of our process in GM. I have a script written here that will:
1. Load in a directory of raster (.tif) files
2. Generate equal area values for all (.tif) files loaded (with specified parameters)
3. Export those equal areas as a shapefile
4. Unload all rasters and equal area features.
5. Load in the equal areas shapefile that was generated above
6. ...
In step 6 I would like to be able to "dissolve" the loaded shapefile (like in ArcMap) into one area leaving behind my "void" areas, but I am having trouble understanding how I might go about this (*see last line of script provided).
1. Load in a directory of raster (.tif) files
2. Generate equal area values for all (.tif) files loaded (with specified parameters)
3. Export those equal areas as a shapefile
4. Unload all rasters and equal area features.
5. Load in the equal areas shapefile that was generated above
6. ...
In step 6 I would like to be able to "dissolve" the loaded shapefile (like in ArcMap) into one area leaving behind my "void" areas, but I am having trouble understanding how I might go about this (*see last line of script provided).
DIR_LOOP_START DIRECTORY="Z:\Edit\miscellaneous\test\Global_Mapper_Scripting\be_rasters" FILENAME_MASKS="*.tif"
IMPORT FILENAME="%FNAME_W_DIR%"
GENERATE_EQUAL_VAL_AREAS FILENAME="%FNAME_W_DIR%" LAYER_DESC="Voids" ATTR_NAME="ELEVATION" ELEV_DIST=4000
UNLOAD_LAYER FILENAME="%FNAME_W_DIR%"
DIR_LOOP_END
EXPORT_VECTOR FILENAME="Z:\Edit\miscellaneous\test\Global_Mapper_Scripting\test_output\voids.shp" TYPE="SHAPEFILE" GEN_PRJ_FILE=YES
UNLOAD_LAYER FILENAME="Voids"
IMPORT FILENAME="Z:\Edit\miscellaneous\test\Global_Mapper_Scripting\test_output\voids.shp"
COMBINE_LINES FILENAME="voids.shp" MAX_DIST=0.1
Thank you for any help!
Mark
Thank you for any help!
Mark
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
- 180 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