GeoTIFF compression doesn't seem to work
Hi again,
I'm trying to implement optional compression in GeoTIFFs.
When I call into GM_ExportElevation, I pass in GM_RasterExportFlags_t32.GM_ExportFlags_UseLZW, or GM_RasterExportFlags_t32.GM_ExportFlags_JPGinTIFF, or nothing.
However, all three types of output are the exact same size and when I open them in Global Mapper application, I can see in the layer metadata that compression is "None".
The input layer is a GMG, could that have anything to do with it?
Cheers,
James
I'm trying to implement optional compression in GeoTIFFs.
When I call into GM_ExportElevation, I pass in GM_RasterExportFlags_t32.GM_ExportFlags_UseLZW, or GM_RasterExportFlags_t32.GM_ExportFlags_JPGinTIFF, or nothing.
However, all three types of output are the exact same size and when I open them in Global Mapper application, I can see in the layer metadata that compression is "None".
The input layer is a GMG, could that have anything to do with it?
Cheers,
James
Comments
-
James,
You are correct that those flags were being ignored. I have updated this so that the GM_ExportFlags_UseLZW flags works. The JPG-in-TIFF only applies to RGB export so it doesn't work for elevation files. I have placed a new SDK build with the working LZW compression at http://www.globalmapper.com/GlobalMapperSDK_v14_latest_beta.zip .
Let me know if I can be of further assistance.
Thanks,
Mike
Global Mapper Guru
gmsupport@bluemarblegeo.com
http://www.bluemarblegeo.com/products/global-mapper.php -
Hi Mike,
Happy new year!
I finally upgraded to the latest beta and got LZW compression working as expected.
One additional question I had was some (mis?)conceptions obtained from this thread:
http://www.globalmapperforum.com/forums/suggestion-box/6253-geotiff-export.html
I expected that JPG-in-TIFF would work for elevations, and that ZIP compression would be an option as well. Am I way off on this?
Thanks again,
James -
James,
The JPEG-in-TIFF compression is only for 3-band RGB images, so it doesn't apply for elevation data which is just a single band of 16-bit integer or 32-bit floating point values.
The DEFLATE compression is what you would use for the same compression algorithm that ZIP uses. Is that what you are using?
Thanks,
Mike
Global Mapper Guru
gmsupport@bluemarblegeo.com
http://www.bluemarblegeo.com/ -
JPEG: thanks for the explanation, I didn't realise the difference there. No worries.
LZW: Forgot to mention in my previous post that I tried the LZW flag on the latest beta and it works fine now. Thanks for that.
ZIP: I was expecting there would be a flag in GM_RasterExportFlags_t32 to enable this option when exporting GeoTIFF elevation, as there is for LZW? -
I have added a new GM_ExportFlags_UseDeflate flag so you can use that in the SDK. I have placed a new build at http://www.globalmapper.com/GlobalMapperSDK_v14_latest_beta.zip for you to try.
Thanks,
Mike
Global Mapper Guru
gmsupport@bluemarblegeo.com
http://www.bluemarblegeo.com/ -
That's brilliant, thanks very much!
For information's sake, I tested out the options for a sample in my app (which is a few small tiles of high res data overlayed onto a large tile of low res data, then cropped and rendered to a middling res.)
No compression: 12,022,450 bytes
LZW compression: 4,283,830 bytes
Zip compression: 2,043,674 bytes
Categories
- 12.8K All Categories
- 5.7K Features Discussion
- 346 Downloading Imagery
- 1.3K Elevation Data
- 385 Georeferencing Imagery Discussion
- 639 GM Script Language
- 54 User Scripts
- 115 GPS Features
- 419 Projection Questions
- 829 Raster Data
- 1.3K Vector Data
- 6.6K Support
- 179 Announcement and News
- 923 Bug Report
- 560 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 574 Other Discussion
- 132 GIS Data Sources
- 27 Global Mapper Showcase
- 241 How I use Global Mapper
- 108 Global Mapper Forum Website