[gdal-dev] VRT file from NetCDF

Yves Jacolin yjacolin at free.fr
Tue Feb 28 11:21:46 EST 2012


Sorry to come again to this thread :)

It seems that when using relatif file for NETCDF for instance, MapServer won't 
work correclty, see Even comment below.

Is it a bug from GDAL? Do I need to open a ticket about this?

>Selon Yves Jacolin <yjacolin at free.fr>:
>> Hello,
>> Etienne asked some question offlist so I investigate.
>> gdal create relatif path by default (I don't see a flag to change this).
>> MapServer and QGIS don't like this.
>MapServer and QGIS don't even know the content of the VRT, so the problem is
>more complex than that.
>If you pass a relative path to gdalbuildvrt or gdal_translate -of VRT, a
>relative path will be written. In which case the VRT driver should be able to
>recompute the full path given the location of the .vrt.
>On the contrary, if you pass an absolute path, it will be store as absolute.
>The issue here is likely with netCDF subdatasets, where the connexion string 
>not a file, but something like "netCDF:xxxx:a_filename", that the VRT driver
>cannot interpret. In that case, the resolution of relative filenames will not
>work. So I'd suggest you to use "netCDF:xxx:full_filename" to avoid those
>issues. Or you must be sure that the current directory of MapServer and QGIS 
>the directory of the .VRT, but you cannot always guarantee this.
>> After changing relatif path to absolute path both are working correctly.
>> Thanks,

Yves Jacolin


More information about the gdal-dev mailing list