[gdal-dev] Potential VRT bug

Harris, Tim Tim.Harris at digitalglobe.com
Tue Feb 12 20:05:20 PST 2019


I came across some strange behavior while panning around a VRT in QGIS. The VRT consists of several large overlapping TIFs where some TIFs have NODATA in areas where other TIFs have data. The behavior is hard to explain, but it looks like the data read from the files is corrupted. Panning around, zooming in and out, anything that triggers another read seems to change the way the data looks. It changes colors, gets skewed, etc. The TIFs themselves are fine on their own.

I have reduced it down to a small subset of the data which is available here (about 2 MB):
https://s3.amazonaws.com/pschmitt-test-public/data.tar.bz2

It consists of two TIFs:
1.tif - fully valid
2.tif - some valid data and some NODATA

I also included three VRTs which I created with these commands:
gdalbuildvrt -r near near.vrt 1.tif 2.tif
gdalbuildvrt -r bilinear bilinear.vrt 1.tif 2.tif
gdalbuildvrt -r bilinear bilinear-reversed.vrt 2.tif 1.tif

If I run this command repeatedly, the min/max of the 4 bands always come out the same:
gdal_translate -projwin 488135 4405500 488374 4405348 near.vrt /vsistdout/ | gdalinfo -mm /vsistdin/

Run this same command on bilinear.vrt, and the min/max change each time. So that's weird.

Run the command on bilinear-reversed.vrt and the min/max are stable just like nearest neighbor resampling. So it seems like it depends on the stacking order of the data, and whatever is going on here doesn't happen with the default resampling. I also tried cubic and it seemed to happen there as well.

I've seen this behavior with GDAL 2.4.0 and also with the current master, commit dc117d571250d7e2442cb003f3dc541114f52766.

This electronic communication and any attachments may contain confidential and proprietary information of DigitalGlobe, Inc. If you are not the intended recipient, or an agent or employee responsible for delivering this communication to the intended recipient, or if you have received this communication in error, please do not print, copy, retransmit, disseminate or otherwise use the information. Please indicate to the sender that you have received this communication in error, and delete the copy you received.

DigitalGlobe reserves the right to monitor any electronic communication sent or received by its employees, agents or representatives.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20190213/0dfc26e6/attachment.html>


More information about the gdal-dev mailing list