[Qgis-user] #1211 Relative paths within QGIS project file

Martin Dobias wonder.sk at gmail.com
Wed Mar 4 04:00:55 PST 2009


On Wed, Mar 4, 2009 at 9:41 AM, Agustin Lobo <Agustin.Lobo at ija.csic.es> wrote:
> Magnus,
>
> Maybe there is a simpler, temporary workaround that would make
> users lives easier on this regard. When QGIS does not find
> a layer as stated in the qgs project, the user could have the
> choice of modifying the path that is going to be searched for that
> given layer and for the rest of layers. Note that, in 99% of the
> cases, the problem arises when the layers are in a portable
> disk that has been mounted on a different computer and gets
> a different path (i.e., in windows yo would have G:\mylayers
> instead of F:\mylayers and on linux you would have
> /media/transcend/mylayers instead of /disk/transcend/mylayers).
> So just a box to be optionally clicked stating "Upgrade default
> path according to browsed layer" (or something like that) in the same dialog
> in which the user is prompted to browse for the layer  would
> not be the optimum solution but a very good one.

Maybe the simplest way would be to add a checkbox "Save with relative
paths" to file dialog when saving a project. The paths to layers will
be automatically saved relatively to project's directory. This might
need probably some heuristics on determining whether layer's URI is a
file but seems like a simplest option, since when moving the files
anywhere, it should "just work".

(my two cents)

Martin



More information about the Qgis-user mailing list