Global Mapper scripting: add GeoPDF export support

pepe.perezpepe.perez Global Mapper UserPosts: 4
edited April 2011 in Suggestion Box
Hello,
I'm a Global Mapper user for several years. For us, it's very important to have the most complete set of commands in the scripting side, because we make an intensive use of scripts. Now that we have found that it's possible to generate GeoPDF from the GUI, it's also very interesting for us to have the possibility to generate GeoPDF from the Global Mapper scripting. For example, we'll use it to generate automatic reports.
Thanks in advance.
José.

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited April 2011
    Jose,

    I will work on adding PDF export support to the scripting interface and get you a new build when it's ready.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited April 2011
    Jose,

    I have completed adding an EXPORT_PDF script command to allow exporting a PDF file from a script. I have placed a new build at http://www.globalmapper.com/global_mapper12.zip with the change for you to try. Simply download that file and extract the contents into your existing v12.xx installation folder to give it a try. If you are using the 64-bit v12 version there is a new build at http://www.globalmapper.com/global_mapper12_64bit.zip .

    Here is the documentation:

    EXPORT_PDF

    The EXPORT_PDF command exports all currently loaded data to a PDF file. The following parameters are supported by the command.

    * FILENAME - full path to file to save the data to
    * DPI - specifies the DPI that the file is generated at.
    * PDF_PAGE_SIZE - specifies the name of the paper size to use. This should match one of the entries on the PDF export dialog, like landscape, portrait, A0, etc.
    * PDF_PAGE_ORIENTATION - specifies the page orientation to use for the generated PDF file. The following values are supported:
    o AUTO - Automatically determine whether to use portrait or landscape mode based on export bounds aspect ratio.
    o PORTRAIT
    o LANDSCAPE
    * PDF_MARGINS - specifies the margins to use in inches. The value should be a comma-delimited list of numbers for the left, top, right, and bottom margins. For example, PDF_MARGINS="0.5,1.0,0.5,1.25" would result in a 0.5 inch margin for the left and right, 1.0 inch for the top, and 1.25 inches for the bottom.
    * PDF_HEADER - specifies the header to use
    * PDF_FOOTER - specifies the footer to use
    * PDF_COMBINE_RASTERS - specifies whether multiple raster layers should be combined into a single layer or kept separate. Use PDF_COMBINE_RASTERS=YES to combine them or PDF_COMBINE_RASTER_LAYERS=NO to keep separate.
    * PDF_FILL_PAGE - specifies whether the PDF export should fill the page or be cropped to the exact bounds specified. Use PDF_FILL_PAGE=YES to enable or PDF_FILL_PAGE=NO to disable.
    * PDF_FONT_SCALE - specifies the scale factor to apply to text. For example use PDF_FONT_SCALE=2.0 to double the size of text.
    * PDF_SYMBOL_SCALE - specifies the scale factor to apply to point symbols and icons. For example use PDF_SYMBOL_SCALE=2.0 to double the size of symbols.
    * VECTOR_ONLY - specifies that only vector layers should be exported to the PDF file. Use VECTOR_ONLY=YES to enable.
    * GLOBAL_BOUNDS - specifies the export bounds in units of the current global projection. There should be 4 values in a comma-delimited list following the parameter name. The values should be in order of minimum x, minimum y, maximum x, maximum y.
    * GLOBAL_BOUNDS_SIZE - specifies the export bounds in units of the current global projection. There should be 4 values in a comma-delimited list following the parameter name. The values should be in order of minimum x, minimum y, width in x, width in y.
    * LAT_LON_BOUNDS - specifies the export bounds in latitude/longitude degrees. There should be 4 values in a comma-delimited list following the parameter name. The values should be in order of westmost longitude, southernmost latitude, easternmost longitude, northernmost latitude.
    * LAYER_BOUNDS - specifies that the export should use the bounds of the loaded layer(s) with the given filename. For example, to export to the bounds of the file "c:\test.tif", you would use LAYER_BOUNDS="c:\test.tif". Keep in mind that the file must be currently loaded.
    * LAYER_BOUNDS_EXPAND - specifies that the operation should expand the used LAYER_BOUNDS bounding box by some amount. The amount to expand the bounding rectangle by should be specified in the current global projection. For example, if you have a UTM/meters projection active and want to expand the bounds retrieved from the LAYER_BOUNDS parameter by 100 meters on the left and right, and 50 meters on the top and bottom, you could use LAYER_BOUNDS_EXPAND="100.0,50.0". You can also specify a single value to apply to all 4 sides, or supply 4 separate values in the order left,top,right,bottom.
    * GRID_TYPE_CELL_SIZE - specifies that the export should be gridded into multiple tiles with each tile having the given size in the export projection. The value should be specified as cell width,cell height. For example, if you are exporting in a metric projection and want to tile the export into cells that are 10,000 meters wide by 5,000 meters tall, you would use GRID_TYPE_CELL_SIZE="10000.0,5000.0".
    * GRID_TYPE_ROWS_COLS - specifies that the export should be gridded into multiple tiles with a given number of rows and columns of tiles. The value should be specified as number of rows,number of columns. For example, if you want to tile the export into a grid of 8 rows each 4 tiles across, you would use GRID_TYPE_ROWS_COLS="8,4".
    * GRID_OVERLAP - specifies how much to overlap tiles when gridding an export into multiple tiles. This is a percentage value from 0 to 100 and only applies when on of the GRID_TYPE_* parameters is used. For example, to make your grid tiles overlap by 5% of the grid tile size, use GRID_OVERLAP="5.0". The default value is 0.0, meaning that the tiles do not overlap.
    * GRID_KEEP_CELL_SIZE - specifies that the size of the grid cells should be maintained over sample spacing. This means that if you specify a grid of 4 rows and 5 columns, each grid cell will be exactly 25% of the total export height and 20% of the total export width. The sample spacing may be slightly smaller than what is specified in order to achieve this. By default, the sample spacing is exactly maintained and each grid cell may be slightly larger than specified to maintain an integer number of exported cells. Use GRID_KEEP_CELL_SIZE=YES to enable.
    * GRID_NAMING - specifies how to name tiles when gridding an export into multiple tiles. The value should be SEQUENTIAL for sequential numeric naming starting at 1, SEPARATE for separate prefix appending by row and column, or SEPARATE_COLS_FIRST for separate prefix appending by columns and rows. For the SEPARATE options, use the GRID_NAMING_COLS and GRID_NAMING_ROWS parameters to specify the details of how to name the rows and columns. If no GRID_NAMING parameter is supplied, the last selected grid naming options selected in the user interface will be used.
    * GRID_NAMING_COLS - specifies how to name the column portion of grid cell names when using the GRID_NAMING=SEPARATE or GRID_NAMING=SEPARATE_COLS_FIRST parameter. The value of this field is a comma-delimited list with the following field values:
    o Naming type. Can have the following values:
    + NUM - name using numbers in ascending order
    + NUM_REVERSE - name using numbers in descending order
    + ALPHA - name using letters in ascending order
    + ALPHA_REVERSE - name using letters in descending order
    o Starting value for numbering or lettering (i.e. '1', or 'A').
    o Prefix string to use before the numeric or alphabetic value.
    o Step value for numeric naming (default is '1')
    You can leave values blank if they don't apply or you want to use the default. As an example, to do numeric naming starting at the number 100, increasing by 10 each time with a prefix of DEM, you would use GRID_NAMING_COLS="NUM,100,DEM,10".
    * GRID_NAMING_ROWS - specifies how to name the row portion of grid cell names when using the GRID_NAMING=SEPARATE parameter. See the documentation for the GRID_NAMING_COLS parameter above for details on the format.
    * GRID_NAMING_PREPEND_ZEROES - specifies whether or not to prepend zeroes to the start of grid column/row names. Use GRID_NAMING_PREPEND_ZEROES=NO to disable the prepending of zeroes.
    * GRID_NAMING_SEPARATOR - specifies the separator string to use between pieces of a grid name. The default is an underscore.
    * GRID_CREATE_FOLDERS - specifies that a separate folder should be generated for each row (or column if GRID_NAMING=SEPARATE_COLS_FIRST is specified) of the export rather than placing every output file in the same folder.
    * OVERWRITE_EXISTING - specifies that existing files should be overwritten. The default is OVERWRITE_EXISTING=YES, so use OVERWRITE_EXISTING=NO to skip exporting files that already exist.


    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • pepe.perezpepe.perez Global Mapper User Posts: 4
    edited April 2011
    Thank you very much, Mike. I'm going to test it right now.
    Best regards,
    José
  • pepe.perezpepe.perez Global Mapper User Posts: 4
    edited April 2011
    Great, Mike. I tested it with the new 12.02 version. This is a great improvement for us.
    Thank you very much for your quick, quick, quick... answer.
    José
  • pepe.perezpepe.perez Global Mapper User Posts: 4
    edited April 2011
    Hi, Mike. I think there's one useful option to add: SAVE_SCALE_AND_LEGEND.
    Best regards,
    José
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited April 2011
    I have now added support for the SAVE_SCALE_AND_LEGEND parameter. I have placed a new build at http://www.globalmapper.com/global_mapper12.zip with the change for you to try. Simply download that file and extract the contents into your existing v12.xx installation folder to give it a try. If you are using the 64-bit v12 version there is a new build at http://www.globalmapper.com/global_mapper12_64bit.zip .

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
Sign In or Register to comment.