Scripting for raster conversions

SchoonhoutSchoonhout Global Mapper UserPosts: 1
edited March 2010 in Technical Support
Can somebody help me with a script to export tiff to ecw with a variable target compression and a variable pixel size in a loop of a certain directory?
I am not really a programmer an seem to make to much mistakes ;)

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited March 2010
    Here is something that should help you get started. You'll of course need to vary your target compression and pixel size values as appropriate for your application:

    GLOBAL_MAPPER_SCRIPT VERSION=1.00
    UNLOAD_ALL

    // Loop over all TIFF files in a folder and convert them
    DIR_LOOP_START DIRECTORY="C:\DATA\" FILENAME_MASKS="*.TIF" RECURSE_DIR=NO

    // Import the TIFF file
    IMPORT FILENAME="%FNAME_W_DIR%"

    // Export the ECW file with the first target compression and size
    EXPORT_RASTER FILENAME="%DIR%%FNAME_WO_EXT%.ECW" TYPE=ECW \
    PIXEL_SIZE="1024x1024" TARGET_COMPRESSION=10


    // Export the ECW file with the another target compression and size
    EXPORT_RASTER FILENAME="%DIR%%FNAME_WO_EXT%_2.ECW" TYPE=ECW \
    PIXEL_SIZE="512x512" TARGET_COMPRESSION=20

    // Unload the loaded data
    UNLOAD_ALL

    // End the loop
    DIR_LOOP_END

    Let me know if I can be of further assistance.

    Thanks,

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