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.

  1. Step 1: Import shapefile and ECW from a directory (Which I have managed)
  2. Step 2: Define the style of the shapefile (Done during import, which I have managed)
  3. 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
If there is anyone that could help me out it would be much appreciated, even if it is a bit of direction.

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




Answers

  • bmg_bobbmg_bob Global Mapper Programmer Posts: 2,218
    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.  
Sign In or Register to comment.