[Qgis-user] QGIS Actions and relative path
Andreas Neumann
a.neumann at carto.net
Wed May 18 05:28:46 PDT 2011
You could probably do this with python. I am not entirely sure if it
works, but there are python actions. The python action gets a reference
to the feature - maybe - if you can access the project file from python,
there is a QgsProject::readPath
(http://doc.qgis.org/head/classQgsProject.html#cfdc9943dcba296540309f89e93a9f60).
This way you can detect the absolute path of the project file and build
your path as you like.
But you are right, it would be convenient if file reference could be
stored relative to the project file.
Maybe Jürgen has some idea.
Andreas
On Wed, 18 May 2011 04:55:44 -0700 (PDT), iomeneandrei wrote:
> Dear all,
> I'm using QGIS 1.6 for windows and I'm using a simple General Action:
> cmd /c %MyField
>
> I'm using it to open some pdf files. In MyField field I have the
> absolute
> path of my files. Is there a way to use a path relative to the QGIS
> project?
>
> It would be fantastic to use (in example) this kind of QGIS project
> structure:
> - /root of the project
> -- /raster spatial file
> -- /vector spatial file
> -- /file called from actions
> - ProjectFile.qgis
>
> I know that QGIS can use relative path for spatial files, but I do
> not know
> if it's possible to use relative path within actions.
>
> Is there a variable that maps the absolute path of the project file?
> If it
> does exist I could write my Action in this way:
> cmd /c $PathOfProjectFile %MyFieldWithRelativePath
>
> Thank you,
>
> a
>
> -----
> Andrea Borruso
>
> ----------------------------------------------------
> email: aborruso at tin.it
> website: http://blog.spaziogis.it
> my 2.0 life: http://aborruso.spaziogis.it
> feed: http://feeds2.feedburner.com/Tanto
> 38° 7' 48" N, 13° 21' 9" E
> ----------------------------------------------------
> --
> View this message in context:
>
> http://osgeo-org.1803224.n2.nabble.com/QGIS-Actions-and-relative-path-tp6377487p6377487.html
> Sent from the qgis-user mailing list archive at Nabble.com.
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user
--
--
Andreas Neumann
Böschacherstrasse 10A
8624 Grüt (Gossau ZH)
Switzerland
More information about the Qgis-user
mailing list