Batch PDF export for multiple polygons
Hi
Firstly I'm quite new to scripting in Global mapper but what I am trying to create is a batch process which allows you to create a pdf at the extent of a polygon that is loaded, but for all your polygons.
So for example if you needed to make a map for each state in America. You could run a script and end up with 48 PDFs, one of each state.
I think I need to use the following Script just not sure how?
POLYGON_CROP_FILENAME_SUFFIX="_RGB_" AND %DATE%
POLYGON_CROP_USE_EACH=YES
POLYGON_CROP_NAME_ATTR=
with a
DIR_LOOP_START and End
Code below mainly need help with Step 3 which is pretty much everything
Thanks
Will
GLOBAL_MAPPER_SCRIPT VERSION="1.00"
/Script to batch export multiple PDFs for multiple polygons
/STEP 1 FOLDER WHERE YOUR FILES ARE IN BETWEEN THE "" Also here we apply a style to our shapefile(DONE)
IMPORT_DIR_TREE DIRECTORY="Z:\TestData\Shape" TYPE="SHAPEFILE" ELEV_UNITS="METERS" LABEL_FIELD_FORCE_OVERWRITE="NO" CODE_PAGE="0"
MODIFY_OVERLAY DATA_SIZE="494"
M:@$!`!$```!J`0``$@```'P!````````?`$```````!\`0```````!0```!\
M`0``+````"P```"H`0````````P```"H`0````````P```"H`0````````P`
M``"H`0``1@```.X!````````[@$`````````````````````````````````
M``````````````````````````````````````````````````#N`0``````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````[@$`````````
M`````````.X!``````````````````````````````````#N`0``````````
M``!497-T4VAA<&5S05-(+G-H<`#1````@```````````````````````````
M``````````````````````````H```(````````*```"`0``````"@```@(`
L``````H```(#```````*```"!```````"@```@4```````H```(&````````
`
end
IMPORT_DIR_TREE DIRECTORY="Z:\TestData\ecw" TYPE="ECW"
/STEP 2 define the project and layout
/************ DEFINE MAP LAYOUT *************/
Like any project
/FINAL STEP EXPORTING & NAMING
EXPORT_PDF FILENAME="Z:\PDF\test" TYPE=PDF DPI=75 PDF_PAGE_SIZE=A0 PDF_FILL_PAGE=YES
Firstly I'm quite new to scripting in Global mapper but what I am trying to create is a batch process which allows you to create a pdf at the extent of a polygon that is loaded, but for all your polygons.
So for example if you needed to make a map for each state in America. You could run a script and end up with 48 PDFs, one of each state.
- Step 1: Import shapefile and ECW from a directory (Which I have managed)
- Step 2: Define the style of the shapefile (Done during import, which I have managed)
- Step 3: Export and Naming (Struggling)
- I need to export to the bounds of each polygon which are all in the same shapefile
- A0
- 75 DPI
- And the extent of the polygon should fill the page exactly
- Name should be saved from an attribute in the layer which I have named "Export" + "_RGB_" + "yyyymmdd" (current date) eg: Florida_RGB_yyyymmdd
I think I need to use the following Script just not sure how?
POLYGON_CROP_FILENAME_SUFFIX="_RGB_" AND %DATE%
POLYGON_CROP_USE_EACH=YES
POLYGON_CROP_NAME_ATTR=
with a
DIR_LOOP_START and End
Code below mainly need help with Step 3 which is pretty much everything
Thanks
Will
GLOBAL_MAPPER_SCRIPT VERSION="1.00"
/Script to batch export multiple PDFs for multiple polygons
/STEP 1 FOLDER WHERE YOUR FILES ARE IN BETWEEN THE "" Also here we apply a style to our shapefile(DONE)
IMPORT_DIR_TREE DIRECTORY="Z:\TestData\Shape" TYPE="SHAPEFILE" ELEV_UNITS="METERS" LABEL_FIELD_FORCE_OVERWRITE="NO" CODE_PAGE="0"
MODIFY_OVERLAY DATA_SIZE="494"
M:@$!`!$```!J`0``$@```'P!````````?`$```````!\`0```````!0```!\
M`0``+````"P```"H`0````````P```"H`0````````P```"H`0````````P`
M``"H`0``1@```.X!````````[@$`````````````````````````````````
M``````````````````````````````````````````````````#N`0``````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````[@$`````````
M`````````.X!``````````````````````````````````#N`0``````````
M``!497-T4VAA<&5S05-(+G-H<`#1````@```````````````````````````
M``````````````````````````H```(````````*```"`0``````"@```@(`
L``````H```(#```````*```"!```````"@```@4```````H```(&````````
`
end
IMPORT_DIR_TREE DIRECTORY="Z:\TestData\ecw" TYPE="ECW"
/STEP 2 define the project and layout
/************ DEFINE MAP LAYOUT *************/
Like any project
/FINAL STEP EXPORTING & NAMING
EXPORT_PDF FILENAME="Z:\PDF\test" TYPE=PDF DPI=75 PDF_PAGE_SIZE=A0 PDF_FILL_PAGE=YES
Tagged:
Answers
-
At the moment, there is not a good way to generate this type of PDF output. We are planning to add the capability to create Map Books to the Map Layout Editor.
One possibility is to split your export into two steps:
1) Use EXPORT_RASTER with POLYGON_CROP_FILE to generate a GeoTIFF (or other image format) image for each state. You can probably use the shapefile containing the states as your crop file, and POLYGON_CROP_USE_EACH to tell GM to export a separate image for each polygon in the file.
2) Iterate through the image files created in step #1 to export the PDFs.
Categories
- 12.9K All Categories
- 5.8K Features Discussion
- 349 Downloading Imagery
- 1.3K Elevation Data
- 385 Georeferencing Imagery Discussion
- 651 GM Script Language
- 55 User Scripts
- 115 GPS Features
- 420 Projection Questions
- 834 Raster Data
- 1.4K Vector Data
- 6.6K Support
- 181 Announcement and News
- 935 Bug Report
- 561 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 578 Other Discussion
- 132 GIS Data Sources
- 27 Global Mapper Showcase
- 244 How I use Global Mapper
- 109 Global Mapper Forum Website

