Bug report #13925

Qlr-file saves datasource path not as absolute path

Added by Filip Mahieu almost 5 years ago. Updated over 1 year ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Project Loading/Saving
Affected QGIS version:2.8.3 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:end of life
Crashes QGIS or corrupts data:No Copied to github as #:21943

Description

When I make a qlr-file, the datasource path is stored in the qlr-file as a relative path. It would be better to save as a absolute path, regardless of what the project path-definition (absolute or relative) is.
I made the qlr starting from a blank project without saving the project.

There was a closed issue that would have fixed it, that I did find yesterday but not anymore today...

Polders__Uit_Shape_.qlr (14.7 KB) Filip Mahieu, 2015-12-01 07:59 AM


Related issues

Related to QGIS Application - Bug report #10858: Datasource file name in .qlr file should be relative to .... Closed 2014-07-09
Related to QGIS Application - Bug report #14340: layer definition file load error Closed 2016-02-20

History

#1 Updated by Sebastian Dietrich almost 5 years ago

Filip Mahieu wrote:

There was a closed issue that would have fixed it, that I did find yesterday but not anymore today...

Is #10858 the issue you mean?

I think it is necessary to let the user decide whether the paths in the qlr-file should be absolute or relative.

  • If the user intends to move the qlr-file along with the data source(s), paths need to be relative.
  • If the qlr-file references a common resource, e.g. a network drive, paths should be absolute.

#2 Updated by Filip Mahieu almost 5 years ago

Maybe that's a good idea Sebastian, but now sometimes it's relative and sometimes absolute, and there seems no control about it (I can't find it obvious..).

It's indeed #10858 I didn't find, but I read it again and it's a bit a different content there though..

#3 Updated by Charles Clancy over 4 years ago

I'm running Essen, and if I create the layer definition file with path set to relative, it can't find the datasource if I load the qlr into a project with existing layers, even though nothing about the folder structure has changed or been moved. The qlr file works fine when dropped into an empty project. One fix was to edit the qlr file with the absolute path. Another of course would be to re-create the layer file with project path set to absolute.
The bottom line is that relative should work if nothing has changed in the file structure - Correct?

#4 Updated by Bo Thomsen about 4 years ago

The behaviour regarding relative/absolute path definitions in qlr files follows the project options "General settings" -> "Save path" which can be set to "absolute" or "relative". The created qlr file will use the same setting as the project at creation time.
Works for 2.16. Haven't checked for earlier version af Qgis

#5 Updated by Giovanni Manghi over 3 years ago

  • Regression? set to No
  • Easy fix? set to No

#6 Updated by Giovanni Manghi over 1 year ago

  • Resolution set to end of life
  • Status changed from Open to Closed

Also available in: Atom PDF