2

I have some VRT layers. If I add them into a blank unsaved project they work fine. If I save a blank project and try to add any of the files I get an error.

Invalid Layer: GDAL provider Cannot open GDAL dataset /GIS DATA/OML VRT/Buidlings.vrt: `/GIS DATA/OML VRT/Buidlings.vrt' not recognized as a supported file format. Raster layer Provider is not valid (provider: gdal, URI: /GIS DATA/OML VRT/Buidlings.vrt

I suspect this is something to do with paths but I can't figure out what it might be.

Sample of a bit of one of the VRTs

<OGRVRTDataSource>
<OGRVRTUnionLayer name="Buildings">
<OGRVRTLayer name="SD_Building">
<SrcDataSource relativeToVRT="1" shared="1">Building</SrcDataSource>
<SrcLayer>SD_Building</SrcLayer>
<GeometryType>wkbPolygon</GeometryType>
<LayerSRS>PROJCS[&quot;British_National_Grid&quot;,GEOGCS[&quot;GCS_OSGB_1936&quot;,DATUM[&quot;OSGB_1936&quot;,SPHEROID[&quot;Airy_1830&quot;,6377563.396,299.3249646]],PRIMEM[&quot;Greenwich&quot;,0.0],UNIT[&quot;Degree&quot;,0.0174532925199433]],PROJECTION[&quot;Transverse_Mercator&quot;],PARAMETER[&quot;False_Easting&quot;,400000.0],PARAMETER[&quot;False_Northing&quot;,-100000.0],PARAMETER[&quot;Central_Meridian&quot;,-2.0],PARAMETER[&quot;Scale_Factor&quot;,0.9996012717],PARAMETER[&quot;Latitude_Of_Origin&quot;,49.0],UNIT[&quot;Meter&quot;,1.0],AUTHORITY[&quot;EPSG&quot;,&quot;27700&quot;]]</LayerSRS>
<Field name="ID" type="String" src="ID" width="38"/>
<Field name="FEATCODE" type="Real" src="FEATCODE" width="38"/>
</OGRVRTLayer>
<OGRVRTLayer name="SE_Building">
<SrcDataSource relativeToVRT="1" shared="1">Building</SrcDataSource>
<SrcLayer>SE_Building</SrcLayer>
<GeometryType>wkbPolygon</GeometryType>
<LayerSRS>PROJCS[&quot;British_National_Grid&quot;,GEOGCS[&quot;GCS_OSGB_1936&quot;,DATUM[&quot;OSGB_1936&quot;,SPHEROID[&quot;Airy_1830&quot;,6377563.396,299.3249646]],PRIMEM[&quot;Greenwich&quot;,0.0],UNIT[&quot;Degree&quot;,0.0174532925199433]],PROJECTION[&quot;Transverse_Mercator&quot;],PARAMETER[&quot;False_Easting&quot;,400000.0],PARAMETER[&quot;False_Northing&quot;,-100000.0],PARAMETER[&quot;Central_Meridian&quot;,-2.0],PARAMETER[&quot;Scale_Factor&quot;,0.9996012717],PARAMETER[&quot;Latitude_Of_Origin&quot;,49.0],UNIT[&quot;Meter&quot;,1.0],AUTHORITY[&quot;EPSG&quot;,&quot;27700&quot;]]</LayerSRS>
<Field name="ID" type="String" src="ID" width="38"/>
<Field name="FEATCODE" type="Real" src="FEATCODE" width="38"/>
</OGRVRTLayer>

I really like the way the VRTs work when they work and I know they are not fully supported but this behaviour seems odd.

QGIS 2.18 Mac OSX 10.11.6 KyngChaos

1

The issue is not in the VRTs but in the .QLR I used to group and style the VRTs.

the paths in the .QLR read as:

./OML VRT/RailStation.vrt

when they should read:

/GIS DATA/OML VRT/RailStation.vrt

I don't know why QGIS has saved them like this but adding in the full path seems to have fixed things for now

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.