I work with a polyline layer:


and the layer located in "G:\desktop\qgis\lyr".

After i save the layer in qlr file and saved it in "G:\desktop\qgis\lyr", i try to load the qlr file with "add from layer definition file" function,to a map that located in "G:\desktop\Project".

The result is that the qlr file doesn't appear on the map and there no properties for that layer. There no symbology either.

table of content

  • Does it work if you add it to a new project? – Joseph Jun 15 '16 at 8:49
  • it doesn't work even in a new project – newGIS Jun 15 '16 at 9:23
  • Which QGIS version are you using? – Joseph Jun 16 '16 at 9:19
  • version QGIS 2.12 – newGIS Jun 19 '16 at 5:23

I've had the same issue. I looked in the .qlr file and saw that the link in the .qlr file to the underlying data file (in my case a .shp file) was relative...meaning the xml in the .qlr file looked like this:

<datasource>./Contour Lines.shp</datasource>

Suspecting the issue might be the .qlr file linking to the actual data, I played around a bit. I found two solutions, and both were path based:

1) Change this to an absolute path and upon reloading the .qlr file all will be well.

2) Move the .qlr file and the underlying data into the same directory where the project file is saved.

It seems the relative path reference is tied to the proejct file location and not the .qlr file location.

Did you find another solution? I hope this helps. There could easily be more going on here than I understand, but it is a workaround.

  • where i find that line? – newGIS Jul 27 '16 at 11:45
  • I tried your solution and the replacement of the relative by the absolute path solves the QLR problem efficiently. Thanks Bryan :) @newGIS : it's in the QLR file. just open it with for example Notepad ++ or any text pad you have. – gisnside Sep 16 '16 at 13:08
  • How do you replace the relative path with an absolute path? – T.O.6 May 8 '17 at 8:36

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.