Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#5985 closed defect (fixed)

Calculating statistics modifies relativeToVRT attribute

Reported by: Mike Taves Owned by: warmerdam
Priority: normal Milestone: 2.0.0
Component: default Version: 1.11.2
Severity: normal Keywords:
Cc: antonio

Description

Creating a VRT file using gdalbuildvrt generally creates a VRT file with relative paths to files, e.g.:

<SourceFilename relativeToVRT="1">tmp/gdalbuildvrt1.tif</SourceFilename>

However, after calculating raster statistics through either gdalinfo -stats mosaic.vrt or calling GDALRasterBand::GetStatistics, this attribute is modified to the default relativeToVRT="0" and the content is modified to an absolute file path:

<SourceFilename relativeToVRT="0">/path/to/tmp/gdalbuildvrt1.tif</SourceFilename>

This quiet modification of the VRT file structure is not expected, and may break the links if the structure is later moved to a different path (assuming the links are still relative).

It would be preferred to preserve the relativeToVRT attribute for VRT files when calculating statistics.

Change History (4)

comment:1 Changed 6 years ago by antonio

Cc: antonio added

comment:2 Changed 6 years ago by Even Rouault

Milestone: 2.0
Resolution: fixed
Status: newclosed

trunk r29291, branches/2.0 r29292 "VRT: preserves relative links on reserialization of existing VRT (#5985)"

comment:3 Changed 6 years ago by Even Rouault

trunk r29293, branches/2.0 r29294 "Fix previous commit to fix breakage in tiff_write_rpc_txt (#5985)"

comment:4 Changed 6 years ago by Even Rouault

Milestone: 2.02.0.0

Milestone renamed

Note: See TracTickets for help on using tickets.