[gdal-dev] Downscaled geotiff with overviews
Matt.Wilkie at yukon.ca
Matt.Wilkie at yukon.ca
Fri Jul 30 12:11:37 PDT 2021
Watching this thread with interest. I’ve wanted to do the same, but from python.
-Matt
From: gdal-dev <gdal-dev-bounces at lists.osgeo.org> On Behalf Of Javier Jimenez Shaw
Sent: July 30, 2021 11:19 AM
To: gdal dev <gdal-dev at lists.osgeo.org>
Subject: [gdal-dev] Downscaled geotiff with overviews
Hi
I want to make a (power-of-two) downscaled version of a geotiff with overviews efficiently with C++ (not from the console).
Let's say I have a geotiff with overviews (external or internal), and I want a copy of it, but at 50% of the size. That is just removing the "base" of the pyramid, but keeping all the other levels. Then voilà, there you have the geotiff 50% smaller, with the overviews already there, almost without any computation. The same for 25% (and any power of 2).
However I do not figure out how to do it efficiently in C++. If I understand correctly, CreateCopy is producing an image with the same size. So to downscale I have to create a new image, read downscaled (that will use the overviews) and write. But later, I have to recreate the overviews on the new image... that are already in the original image.
Is there any way to make it efficiently? (as we have the data there)
Thanks.
.___ ._ ..._ .. . ._. .___ .. __ . _. . __.. ... .... ._ .__
Entre dos pensamientos racionales
hay infinitos pensamientos irracionales.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20210730/10ee8503/attachment.html>
More information about the gdal-dev
mailing list