<div dir="ltr">Hi Even,<br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 29, 2017 at 2:38 PM, Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@spatialys.com" target="_blank">even.rouault@spatialys.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>
<div style="font-family:monospace;font-size:9pt;font-weight:400;font-style:normal">
<p style="margin:0px;text-indent:0px">Hi Sean,</p><span class="gmail-m_4714997559265743319gmail-">
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">> </p>
<p style="margin:0px;text-indent:0px">> It's been my understanding that GDAL's RasterIO (most current version) uses</p>
<p style="margin:0px;text-indent:0px">> overviews when available, implicitly. Is this also true for VRTs and warped</p>
<p style="margin:0px;text-indent:0px">> VRTs or is not true?</p>
<p style="margin:0px;text-indent:0px"> </p>
</span><p style="margin:0px;text-indent:0px">Yes, it is supposed to, and below demonstrates a working case of that capability:</p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">(byte.tif is</p>
<p style="margin:0px;text-indent:0px"><a href="https://github.com/OSGeo/gdal/blob/trunk/autotest/gcore/data/byte.tif" target="_blank">https://github.com/OSGeo/gdal/<wbr>blob/trunk/autotest/gcore/data<wbr>/byte.tif</a>)</p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">gdal_translate byte.tif test.tif -outsize 2048 2048</p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">Create uniformly grey overview:</p>
<p style="margin:0px;text-indent:0px">gdal_translate test.tif test.tif.ovr -outsize 256 256 -scale 0 255 127 127</p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">gdalwarp test.tif test_warped.vrt -of VRT -t_srs EPSG:3857 -overwrite</p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">gdal_translate test_warped.vrt small.tif -outsize 256 256 --debug on</p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">small.tif is grey as expected</p><span class="gmail-m_4714997559265743319gmail-">
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">> </p>
<p style="margin:0px;text-indent:0px">> I ask because 1) in reading from a warped VRT (using vsicurl) I'm not</p>
<p style="margin:0px;text-indent:0px">> seeing use of the overviews in the GeoTIFF source that surface in the VRT,</p>
<p style="margin:0px;text-indent:0px">> and </p>
<p style="margin:0px;text-indent:0px"> </p>
</span><p style="margin:0px;text-indent:0px">Perhaps you're doing something different from the above ?</p><span class="gmail-m_4714997559265743319gmail-">
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">> 2) in reading the source of gdalwarp_lib.cpp I see that it has its own</p>
<p style="margin:0px;text-indent:0px">> code for navigating overview levels and does not rely on any implicit</p>
<p style="margin:0px;text-indent:0px">> overviews.</p>
<p style="margin:0px;text-indent:0px"> </p>
</span><p style="margin:0px;text-indent:0px">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 :</p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px"><a href="https://github.com/OSGeo/gdal/blob/trunk/gdal/frmts/vrt/vrtwarped.cpp#L550" target="_blank">https://github.com/OSGeo/gdal/<wbr>blob/trunk/gdal/frmts/vrt/vrtw<wbr>arped.cpp#L550</a></p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">Even</p></div></blockquote></div><br>Indeed, I had gotten myself into a situation where the test at</div><div class="gmail_extra"><br></div><div class="gmail_extra"><a href="https://github.com/OSGeo/gdal/blob/7f622319fee6ff75e6ddab1b6225684264f34d85/gdal/frmts/vrt/vrtsourcedrasterband.cpp#L169" target="_blank">https://github.com/OSGeo/gdal/<wbr>blob/<wbr>7f622319fee6ff75e6ddab1b622568<wbr>4264f34d85/gdal/frmts/vrt/<wbr>vrtsourcedrasterband.cpp#L169</a><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">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.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">Thanks and bon weekend,</div><div class="gmail_extra"><div><br></div>-- <br><div class="gmail-m_4714997559265743319gmail_signature"><div dir="ltr">Sean Gillies</div></div>
</div></div>