I am trying to export multiple layers of contours to file. I want to export individually. They have
I am trying to export multiple layers of contours to file. I want to export individually. They have no file name as i have generated in GM.
When I export using the EXPORT_VECTOR in a script. Even switching on or off the layers all the vector layers are visible in each export. How can I prevent this??
Thanks
Best Answer
-
Your FILENAME parameter for the output isn't correct. It would export to a new EXPORT_CONTOURS_DIR folder under the root of your current drive, if that's even writable.
You should use:
FILENAME="%EXPORT_CONTOURS_DIR%\%LAYER_DESC%.shp"
You can also run this using File->Run Script to see if the script log gives you any helpful information if there are still issues.
Thanks,
Mike
Global Mapper Guru
Answers
-
I would suggest using a LAYER_LOOP_START ... LAYER_LOOP_END in the script to loop over the layers. See https://www.bluemarblegeo.com/knowledgebase/global-mapper-25/cmd/LAYER_LOOP_START.htm#LAYER_LOOP_START for details.
Since your layers don't have filenames, instead use the description of the layers (which I assume is unique) to specify which layer to export in your EXPORT_VECTOR call, like EXPORT_LAYER="%LAYER_DESC%" as a parameter of the EXPORT_VECTOR command.
Thanks,
Mike
Global Mapper Guru
-
Hi thanks for the help. My script now looks like this but
GLOBAL_MAPPER_SCRIPT VERSION="1.00"
DEFINE_VAR NAME="EXPORT_CONTOURS_DIR" VALUE="Y:\03 - Interpretation\07 - Deliverables\Contour_Export"
LAYER_LOOP_START LAYER_DESC="*Contours*"
SET_LAYER_OPTIONS HIDDEN=NO
EXPORT_VECTOR EXPORT_LAYER="%LAYER_DESC%" FILENAME="\EXPORT_CONTOURS_DIR\%LAYER_DESC%.shp" TYPE=SHAPEFILE SHAPE_TYPE=LINES TYPE=SHAPEFILE INC_ELEV_ATTR=YES INC_LAYER_ATTR=YES
SET_LAYER_OPTIONS HIDDEN=YES
LAYER_LOOP_END
But it is not exporting any files
-
Thanks for the help. Working now :)
Categories
- 12.8K All Categories
- 5.7K Features Discussion
- 345 Downloading Imagery
- 1.3K Elevation Data
- 385 Georeferencing Imagery Discussion
- 637 GM Script Language
- 54 User Scripts
- 114 GPS Features
- 417 Projection Questions
- 826 Raster Data
- 1.3K Vector Data
- 6.6K Support
- 178 Announcement and News
- 913 Bug Report
- 558 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 569 Other Discussion
- 131 GIS Data Sources
- 27 Global Mapper Showcase
- 238 How I use Global Mapper
- 107 Global Mapper Forum Website