[GIS] QGIS working directory

qgis

I was just wondering what's the best way to organise QGIS projects. My problem is that I work across different platforms, Mac, Win and Linux and the project contents are stored with links to the files.

I have organised my files in a DATA partition, which gets mounted under /Volumes on Mac and /media etc. on Linux.
Hence, a QGIS project created on a Mac will not be able to load files when you open it on Linux due to the different file paths.

I am not enough of a computer geek to change mount points or anything like that.

I was just wondering if there is a relatively easy way to solve this problem?

Best Answer

The best way, if the data doesn't move and you always mount that same drive/folder is the use relative project paths in the project file. This should be the default however you can check it in the project properties:

enter image description here

So you could have this setup:

|- DATA
  |-GIS_DATA
  |-PROJECTS

Store you projects in the Projects folder and load the data from the gis data folder. The relative paths will mean that in the project file you will have something like this:

layer = ./GIS_DATA/mylayer.shp

and it will work on any platform.

Pro Tip: If you start QGIS with the --optionspath and --configpath you can move all your settings to the DATA folder to in order to share settings as well:

qgis --optionspath /media/DATA/qgis --configpath /media/DATA/qgis
Related Question