Global Mapper Pro

Set compression method to LZW using GENERATE_ELEV_GRID?

jemuzza
jemuzza Global Mapper UserTrusted User
edited August 2014 in GM Script Language
Hello again!

I'm trying to run a script for a DSM export (GEOTIFF).

I've looked through the Global Mapper Script Reference but I am unable to locate a method for setting the compression type to 'Default (LZW Compression)' which I am assuming would export at bit depth of 32.

I have tried adding in the 'COMPRESSION=LZW' which works for images but I cannot get it working for elevation grids.

Here is my code:

IMPORT FILENAME="import.tif"
EXPORT_ELEVATION FILENAME="export.tif" SPATIAL_RES_METERS="0.1,0.1" POLYGON_CROP_FILE="crop.dxf" TYPE="GEOTIFF" COMPRESSION=LZW FORCE_SQUARE_PIXELS="YES" BG_TRANSPARENT=YES GEN_PRJ_FILE=YES GEN_WORLD_FILE=YES GEN_TAB_FILE=YES

Thanks,
James

Comments

  • Jasmine_BMG
    Jasmine_BMG BMG Staff
    edited August 2014
    Hello James,

    That script looks like it should work fine, are you getting an error or a bad result? If so, please let us know what the error or unexpected results are and what version of the application you are using.

    Regards,

    Jasmine
  • Jasmine_BMG
    Jasmine_BMG BMG Staff
    edited August 2014
    Hi James,

    The script seems to export to GeoTIFF fine in the current version - but, you will need to add BYTES_PER_SAMPLE=4 to EXPORT_ELEVATION. As is, the script will generate a 16-bit.

    Best,

    Jasmine
  • jemuzza
    jemuzza Global Mapper User Trusted User
    edited August 2014
    Thanks very much for the help Jasmine, much appreciated.

    The "BYTES_PER_SAMPLE=4" brought it up to 32bit. My elevation grid has no compression though, that is, the "COMPRESSION=LZW" seems to have no effect unlike when it is used for image raster exports. I'm running v12.02.
  • samknight
    samknight BMG Staff
    edited August 2014
    Hi Jemuzza,
    The compression settings are working as expected in the current version, perhaps there was a bug that was previously fixed in one of the last few releases. Would you be able to try your script in an evaluation of the current version?

    Regards,
    Sam Knight
    Director of Product Management
    Blue Marble Geographics
  • jemuzza
    jemuzza Global Mapper User Trusted User
    edited August 2014
    Thanks again Sam,

    I'll run it at work with v15 and let you know how I go.

    James
Sign In or Register to comment.