Exporting a geotif raster with overviews/pyramids
Hi,
I'm trying to export a huge raster (eg 25000x19000 or even bigger) or a lot of smaller ones (let's say 2048x2048) using the GM_ExportRasterEx c++ function. I really need to create the overviews to speed up the display of these exported orthophotographies.
Using SDK 26, I tried
status = GM_ExportRasterEx(newName, GM_Export_GeoTIFF, &rasterLayerInfo._layer, 1, &bounds, width, height, GM_ExportFlags_UseLZW, "ADD_OVERVIEW_LAYERS=YES");
using the "ADD_OVERVIEW_LAYERS=YES" option found somewhere in this forum, but it does not seem to be working.
I also tried
GM_SetMiscOption(GM_MiscOpt_GeoTIFFExportOverview, 1);
but that's not any better.
I guess I missed something ?
Thanks,
Yann
Best Answers
-
Hi Yann,
I took a look and found that there is not a way to specify that overview layers should be included for GeoTIFF export using the GM_ExportRasterEx command. I have created a new task (GMSDK-649) for adding this capability.
In the meantime, you can achieve that by using the GM_RunScript function that uses an EXPORT_RASTER script command with the ADD_OVERVIEW_LAYERS=YES parameter added. See https://www.bluemarblegeo.com/knowledgebase/global-mapper/cmd/EXPORT_RASTER.htm?tocpath=Global%20Mapper%20Script%7CGlobal%20Mapper%20Scripting%20Reference%7CExport%7C_____9 for documentation of that script command.
Thanks,
Mike
Global Mapper Guru
-
Right now there isn't any way to control which overviews are written. We will add overview layers at powers of 2 under the initial image size until the first one is below 1,000,000 pixels. I can create a ticket to add a way to customize the minimum pixel level to create overviews to though.
Thanks,
Mike
Global Mapper Guru
Answers
-
It seems to be working using GM_Export_Erdas_Imagine instead of GM_Export_GeoTIFF. Is it limited to that specific format ?
-
Hi Mike.
Would you happen to know if there is a hidden option to set the required overview levels in the script command ? I was unable to find any in the documentation.
Default behavior seems to create pyramids 1024x1024 and 512x512 for my 2048x2048 textures, but I would greatly benefit from smaller ones (down to 64x64 or 32x32).
Thanks again.
-
Hi Mike,
I noticed that gdal.dll is provided within the GlobalMapper SDK environment, so I decided to use the GDALDataSe::BuildOverviews method, which gives me full control on the pyramids parameters.
Thanks again for your help,
Yann
Categories
- 13K All Categories
- 5.8K Features Discussion
- 351 Downloading Imagery
- 1.3K Elevation Data
- 385 Georeferencing Imagery Discussion
- 652 GM Script Language
- 56 User Scripts
- 115 GPS Features
- 422 Projection Questions
- 837 Raster Data
- 1.4K Vector Data
- 6.7K Support
- 182 Announcement and News
- 944 Bug Report
- 565 SDK
- 1.2K Suggestion Box
- 3.8K Technical Support
- 582 Other Discussion
- 132 GIS Data Sources
- 27 Global Mapper Showcase
- 245 How I use Global Mapper
- 111 Global Mapper Forum Website
