Scripting for raster conversions
Schoonhout
Global Mapper User
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
I am not really a programmer an seem to make to much mistakes
Comments
-
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
Categories
- 12.7K All Categories
- 5.6K Features Discussion
- 342 Downloading Imagery
- 1.3K Elevation Data
- 380 Georeferencing Imagery Discussion
- 628 GM Script Language
- 53 User Scripts
- 113 GPS Features
- 414 Projection Questions
- 819 Raster Data
- 1.3K Vector Data
- 6.6K Support
- 177 Announcement and News
- 908 Bug Report
- 558 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 562 Other Discussion
- 129 GIS Data Sources
- 27 Global Mapper Showcase
- 233 How I use Global Mapper
- 107 Global Mapper Forum Website