On mercredi 8 mars 2017 19:38:24 CET Luis Ressel wrote: > Hello, > > VRTs can reference other files by relative paths. Upon reading such a > VRT, GDAL will evaluate the relative path based on the directory where > the VRT resides. Now, imagine the following situation: > > * There's a directory a/ containing several raster files and a VRT > referencing them. > > * There's a second directory b/ containing a symlink to the VRT in a/ . > > When I point GDAL at b/symlink.vrt, it will dereference the symlink > before evaluating the relative paths inside the VRT (and thus search > for the rasters in a/), whereas I would've expected GDAL to handle > the symlink transparently and search for the rasters in b/ . > > Is this the intended behaviour?
Given that the existing behaviour is a reasonable one, I'd say yes. That's said your use can can probably also makes sense. > Unfortunately, I can't make much > sense of the relevant code in gdal/frmts/vrt/vrtsources.cpp. The relevant piece of code is in https://github.com/OSGeo/gdal/blob/trunk/gdal/frmts/vrt/vrtdataset.cpp#L739 If you look a bit below in https://github.com/OSGeo/gdal/blob/trunk/gdal/frmts/vrt/vrtdataset.cpp#L814 there's an open option ROOT_PATH that could be set to b/ to get the behaviour you wish. Or you could add an open option, RESOLVE_SYMLINK=NO, to disable the stuff at https://github.com/OSGeo/gdal/blob/trunk/gdal/frmts/vrt/vrtdataset.cpp#L745 Evn -- Spatialys - Geospatial professional services http://www.spatialys.com
_______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/gdal-dev