[gdal-dev] Warped VRT and overviews

Even Rouault even.rouault at spatialys.com
Fri Sep 29 13:38:59 PDT 2017


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

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20170929/3fe5f3a3/attachment.html>


More information about the gdal-dev mailing list