[gdal-dev] Warped VRT and overviews

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[gdal-dev] Warped VRT and overviews

Sean Gillies-3
Hi all,

It's been my understanding that GDAL's RasterIO (most current version) uses overviews when available, implicitly. Is this also true for VRTs and warped VRTs or is not true? 

I ask because 1) in reading from a warped VRT (using vsicurl) I'm not seeing use of the overviews in the GeoTIFF source that surface in the VRT, and 2) in reading the source of gdalwarp_lib.cpp I see that it has its own code for navigating overview levels and does not rely on any implicit overviews.

Thanks in advance,

--
Sean Gillies

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Warped VRT and overviews

Sean Gillies-3
Hi Even,

On Fri, Sep 29, 2017 at 2:38 PM, Even Rouault <[hidden email]> wrote:

Hi Sean,

 

>

> It's been my understanding that GDAL's RasterIO (most current version) uses

> overviews when available, implicitly. Is this also true for VRTs and warped

> VRTs or is not true?

 

Yes, it is supposed to, and below demonstrates a working case of that capability:

 

(byte.tif is

https://github.com/OSGeo/gdal/blob/trunk/autotest/gcore/data/byte.tif)

 

gdal_translate byte.tif test.tif -outsize 2048 2048

 

Create uniformly grey overview:

gdal_translate test.tif test.tif.ovr -outsize 256 256 -scale 0 255 127 127

 

gdalwarp test.tif test_warped.vrt -of VRT -t_srs EPSG:3857 -overwrite

 

gdal_translate test_warped.vrt small.tif -outsize 256 256 --debug on

 

small.tif is grey as expected

 

>

> I ask because 1) in reading from a warped VRT (using vsicurl) I'm not

> seeing use of the overviews in the GeoTIFF source that surface in the VRT,

> and

 

Perhaps you're doing something different from the above ?

 

 

> 2) in reading the source of gdalwarp_lib.cpp I see that it has its own

> code for navigating overview levels and does not rely on any implicit

> overviews.

 

Yes gdalwarp itself can be told which overview level to use from the source raster, but the VRT warped code also has logic to use overviews of the source raster :

 

https://github.com/OSGeo/gdal/blob/trunk/gdal/frmts/vrt/vrtwarped.cpp#L550

 

Even


Indeed, I had gotten myself into a situation where the test at


failed and the overviews were skipped. Thanks for getting me back on the right track. The VRTWarpedDataset class is very handy. I'm looking forward to being able to use VSICurlClearCache in production, it'll be handy for testing my warped VRT code.

Thanks and bon weekend,

--
Sean Gillies

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev