KIOS-Research / ImportPhotos

This tool can be used to import Geo-Tagged photos (jpg or jpeg) as points to QGIS.
GNU General Public License v3.0
36 stars 28 forks source link

Seems not working with relative path #114

Closed Dret42 closed 6 months ago

Dret42 commented 7 months ago

Hi, it's possible to make this plugin works with photo relative path?

I'm using a project inside a geopackage. In the same location is placed the folder with geotagged photos.

If I move both to another folder the photo are not loaded anymore.

In this way is impossible to share the project with others.

Or maybe I'm doing something wrong??

Thanks!

holesond commented 7 months ago

Hi,

I think that the current version of ImportPhotos does not handle relative paths correctly. A related issue is #105.

I have proposed a fix to the issue, see my pull request #112. It creates all relative photo paths relatively to the QGIS project root, that is the folder containing the qgs/qgz project file. Therefore if one moves the entire project folder (containing the qgs/qgz file, geopackage(s), photo folders) to another directory, the photos can still be loaded. If you want to try the ImportPhotos plugin with my fix, you can download it from https://github.com/holesond/ImportPhotos/tree/fix-viewer-relpath. However, you will need to import the photos into a new layer in your QGIS project again, the proposed fix cannot correct the (incorrect) relative paths produced by ImportPhotos v3.0.5 (or earlier).

(P.S. I am not sure how one can have a project inside a geopackage. QGIS projects are usually stored in qgs/qgz project files. A project file contains links to e.g. vector layers, which can be stored in one or more geopackages, SHP files, etc.)

Dret42 commented 7 months ago

In the meantime I have found an alternative solution using the native QGIS tool "Import Geotagged Photo" together with custom rules using expressions to generate a link relating to the project file (however, I still cannot manage a project file inside a geopackage).

P.S. Yes, you can put a QGIS project file directly into a geopackage (I use it constantly!). In this way all your project is wrapped into a single object!

Mariosmsk commented 6 months ago

Merge pull #112, and create the new version ImportPhotos v3.0.6,