[gdal-dev] gdalbuildvrt changes data when building VRT

Frank Warmerdam warmerdam at pobox.com
Mon Jan 30 20:23:18 EST 2012


On Mon, Jan 30, 2012 at 1:17 PM, John Twilley <mathuin at gmail.com> wrote:
> I'm using gdalbuildvrt as a simple way to merge adjoining data files.
> Unfortunately, I'm noticing that some values change.  I've created a
> simple test case where I make a VRT from a single GeoTIFF and compare
> histograms before and after, and I've attached it to this message.
> Can someone tell me why this is happening and how to avoid it?
> Thanks!

John,

It looks like your source TIFF file was generated by gdal_translate
on an HDF file (or perhaps it has an .aux or .aux.xml file associated
with it) and thus it has "built in" knowledge of the histogram which is
getting used whether it reflects the reality of the image or not.

This sort of histogram and statistics metadata is not copied to the
VRT by gdalcreatevrt so a request for it ends up in recomputing from
the imagery data.  I'd assume then that the information from the
destination file are right, and the source is wrong though it is hard
to confirm this without having the imagery at hand to test.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Software Developer


More information about the gdal-dev mailing list