Bug report #13627

relative paths broken in 2.8.3

Added by Gavin Fleming about 9 years ago. Updated almost 9 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:-
Affected QGIS version:2.8.3 Regression?:No
Operating System:ubuntu Easy fix?:No
Pull Request or Patch supplied:No Resolution:worksforme
Crashes QGIS or corrupts data:No Copied to github as #:21664

Description

I have some tif layers that I need to serve with QGIS server. When I sync my project to the server the tifs do not work. I have to edit the project file manually. My desktop QGIS 2.8.3 does write the paths relative, but goes back too many steps(../../../../ etc instead of just ../), resulting in the path back up to the tif consisting of local directories. It should be finding the shortest/most local possible relative path. The behaviour now effectively has the same effect as absolute paths.

History

#1 Updated by Jürgen Fischer about 9 years ago

Can you provide sample data? Seems to work fine here. Eg. a project once saved with relative paths and once with absolute paths.

#2 Updated by Gavin Fleming about 9 years ago

My QGIS writes this, with the path going back down to my home dir:

<datasource>../../../../Documents/kartoza/Projects/2015/AgriTechnovation/repo/work/PPM/Bladspringer_week_18.tif</datasource>

when it should be writing this:

<datasource>../../work/PPM/Bladspringer_week_18.tif</datasource>

2.8.3 local build from source.

#3 Updated by Jürgen Fischer about 9 years ago

  • Status changed from Open to Feedback

Not reproducable here:

$ egrep "<qgis|datasource" Documents/kartoza/Projects/2015/AgriTechnovation/repo/1/2/*.qgs
Documents/kartoza/Projects/2015/AgriTechnovation/repo/1/2/abs.qgs:<qgis projectname="" version="2.8.3-Wien">
Documents/kartoza/Projects/2015/AgriTechnovation/repo/1/2/abs.qgs:      <datasource>/home/fischer/Documents/kartoza/Projects/2015/AgriTechnovation/repo/work/PPM/Bladspringer_week_18.tif</datasource>
Documents/kartoza/Projects/2015/AgriTechnovation/repo/1/2/rel.qgs:<qgis projectname="" version="2.8.3-Wien">
Documents/kartoza/Projects/2015/AgriTechnovation/repo/1/2/rel.qgs:      <datasource>../../work/PPM/Bladspringer_week_18.tif</datasource>
$ apt-cache policy qgis
qgis:
  Installed: 1:2.8.3+git20151014+011109a+99unstable
  Candidate: 1:2.8.3+git20151014+011109a+99unstable
  Version table:
 *** 1:2.8.3+git20151014+011109a+99unstable 0
        500 http://qgis.org/debian-nightly-ltr/ unstable/main amd64 Packages
        100 /var/lib/dpkg/status
     2.8.3+dfsg-3 0
        500 http://approx:9999/debian/ unstable/main amd64 Packages

#4 Updated by Giovanni Manghi almost 9 years ago

  • Resolution set to worksforme
  • Status changed from Feedback to Closed

closing for lack of feedback.

#5 Updated by Gavin Fleming almost 9 years ago

the issue was that the layer was in a soft-linked directory. QGIS was following the link and storing the absolute path to the actual file and not the relative path to the link. I'm not sure if that is intended behaviour.

Also available in: Atom PDF