<div dir="ltr"><div dir="ltr">Even,<br><br>Thank you for your response.<br><br>Since you can't reproduce this with your test it makes me think there is something about the input data. I put together some sample data in a public S3 bucket and some commands. Would you be able to try them out to see if that reproduces the behaviour? I tried GDAL 2.2.3, GDAL 2.4.2, and GDAL 3.0.1 and saw the same thing. No overlay use with any resampling method other than nearest.<br><br>The COGS are single band float32 with zero indicating NODATA and the VRT is built with using <font face="monospace">gdal.BuildVRT('mosaic.vrt', files, options=gdal.BuildVRTOptions(srcNodata=0, VRTNodata=0))</font><font face="arial, sans-serif"> in Python. The VRT also has pre-built statistics, if that is a factor.</font><div><font face="arial, sans-serif"><br></font></div><div><font face="monospace"># v3.0.1<br>gdalinfo --version<br><br># Output looks normal to me.<br>gdalinfo /vsicurl/<a href="https://dev-myheat-ca.s3-us-west-2.amazonaws.com/data/gdal/mosaic.vrt">https://dev-myheat-ca.s3-us-west-2.amazonaws.com/data/gdal/mosaic.vrt</a> --config GDAL_DISABLE_READDIR_ON_OPEN EMPTY_DIR<br><br># This is actually your tool I think! Reports the COG as valid.<br>python validate_cloud_optimized_geotiff.py /vsicurl/<a href="https://dev-myheat-ca.s3-us-west-2.amazonaws.com/data/gdal/20.cog.tiff">https://dev-myheat-ca.s3-us-west-2.amazonaws.com/data/gdal/20.cog.tiff</a><br><br># ~4 seconds (--debug ON will show GDAL loading overviews)<br>gdal_translate /vsicurl/<a href="https://dev-myheat-ca.s3-us-west-2.amazonaws.com/data/gdal/mosaic.vrt">https://dev-myheat-ca.s3-us-west-2.amazonaws.com/data/gdal/mosaic.vrt</a> /tmp/tile.tiff -projwin -9177335.364031402 5305341.259217514 -9174889.379126277 5302895.274312388 -outsize 256 256 -r nearest --config GDAL_DISABLE_READDIR_ON_OPEN EMPTY_DIR<br><br># ~60 seconds (--debug ON will show GDAL loading full resolution data)<br>gdal_translate /vsicurl/<a href="https://dev-myheat-ca.s3-us-west-2.amazonaws.com/data/gdal/mosaic.vrt">https://dev-myheat-ca.s3-us-west-2.amazonaws.com/data/gdal/mosaic.vrt</a> /tmp/tile.tiff -projwin -9177335.364031402 5305341.259217514 -9174889.379126277 5302895.274312388 -outsize 256 256 -r bilinear --config GDAL_DISABLE_READDIR_ON_OPEN EMPTY_DIR</font><br><font face="arial, sans-serif"><br>Could it have to do with the data being float32 or the way the overviews are built? GDAL seems to be making the choice to skip the overviews for some reason.<br><br>Thank again,<br><br>Angus<br></font><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><br></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Oct 30, 2020 at 8:53 AM Even Rouault <<a href="mailto:even.rouault@spatialys.com">even.rouault@spatialys.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Angus,<br>
<br>
> But the second command ignores the overviews and downloads the full<br>
> resolution imagery leading to very long download times. Is it expected<br>
> behaviour that all re-sampling methods except 'nearest neighbour' need to<br>
> request the full resolution data? Can't they apply the selected re-sampling<br>
> method to the overviews? Is it something to do with the way I created my<br>
> VRT file?<br>
<br>
I can't confirm with the following little test<br>
<br>
gdal_translate byte.tif test.tif -outsize 2048 2048<br>
gdal_translate test.tif left.tif -srcwin 0 0 1024 2048 -b 1 -b 1 -b 1<br>
gdal_translate test.tif right.tif -srcwin 1024 0 1024 2048 -b 1 -b 1 -b 1<br>
gdalbuildvrt vrt.vrt left.tif right.tif<br>
gdaladdo left.tif<br>
gdaladdo right.tif<br>
python -c "from osgeo import gdal; ds = gdal.Open('left.tif', gdal.GA_Update); <br>
ds.GetRasterBand(1).GetOverview(2).Fill(0)"<br>
<br>
copy left.tif, right.tif and vrt.vrt on S3<br>
<br>
gdal_translate /vsis3/mybucket/vrt.vrt out.tif -r bilinear -outsize 128 128<br>
<br>
Works fine with GDAL 2.4.4 and master<br>
<br>
If you can come up with a minimum reproducing scenario (input files + script/<br>
command to reproduce), please file a ticket on github<br>
<br>
Even<br>
<br>
-- <br>
Spatialys - Geospatial professional services<br>
<a href="http://www.spatialys.com" rel="noreferrer" target="_blank">http://www.spatialys.com</a><br>
</blockquote></div></div>