7

I have a map of an area and georeferenced photos. I need to be able to bring the pictures as points and then be able to click at a certain point and an image pop up.

I have revisited this issue, i managed to get this far but the pop up doesn't work.

See image:

enter image description here

  • 1
    Welcome to gis.stackexchange! Please note that a good question on this site is expected to show some degree of research on your part, i.e. what you have tried and - if applicable - code so far. For more info, you can check our faq. – underdark Aug 30 '15 at 8:32
6

Like Maj said, I think that he easiest way to do something like you said is based om the map tips functionality. You can find the steps by step description here

  • First you should have a file name or a path in the points layer attributes associated with your pictures.
  • Second, edit the map tips with following HTML code :
    < img src="[% image %]" width=300 height=300 >
    Where [% image %]refers to the path of your picture
  • Alternatly you can set
    < img src="YOURPATHT/[% image %]" width=300 height=300 >
    if [% image %] refers to your file name.

    This was quite effective for me. Hope it helps.

    • 2
      The HTML code in the answer didn't work as is, there is an extra space before img and the end should be />. Here is what worked for me in QGIS 2.18.9 (photo refers to the field name I'm using to store the image path): <img src=[% "photo" %] width=300 height=300 /> – Techie_Gus Jun 9 '17 at 18:30
    2

    You need to create a point file from your georeferenced photos (if you haven't already) and include the file-path of your image in the attribute table (which again may already exist depending on how the geo-ref photos have been created). It is then possible to use hyperlinks that will open your photo as a pop-up when you select the point in the map view.

    Below are some step by step guides, but essentially you need to use activate map tips in the layer properties so that the point will open a hyperlink when it is selected.

    https://www.youtube.com/watch?v=CUxkddOP3BQ http://manual.linfiniti.com/en/create_vector_data/actions.html

    More info on map tips:

    http://nathanw.net/2012/08/05/html-map-tips-in-qgis/

    qgis how to assign a field to map tips

    2

    At 3.8.0, here's what works for me:

    1. Create a point layer (Geopackage, shape file, etc)

    2. Create a text attribute field in the point layer:

      • call it, say, image_path
      • A reasonable maximum length is 320 characters, which will be able to contain the max Windows file path length. EDIT: If you are using a shapefile, the maximum length for a text field is 254 characters.
    3. Edit that attribute table and populate image_path with the file path and name for the image associated with each record, such as: file:///C:\TEST\IMAGES\photo_1.jpg

      • note the prefix file:///
      • this prefix is required, starting (I think) at QGIS 3.x. It doesn't appear to be necessary at 2.x
      • the image file name will likely be unique for each record in the table; that is, you will likely (but not necessarily) have a different image path/name for each map point.
    4. In the QGIS map document:

      • Open the point Layer Properties window > Display
      • In the HTML Map Tip pane, insert this line: <img src=[% "image_path" %] />, where image_path is the attribute field name from #2 above.
      • Click Ok
    5. Make sure that QGIS > View > Show Map Tips is checked on.

    6. Hover the cursor over one of the points.

    7. Voila, the image pops up!

    • 1
      I had to add quotes around my path: <img src="[% (formula) %]" /> – user94812 Jul 20 at 1:05
    1

    While all other answers are correct,
    since 2018, the easiest way to do this is use the import photos plugin.
    It works very well and fast on a folder of georefrenced photos and creates fields for both the full path and the relative path to where you create the shapefile.

    • ... well, would be great, but for me on Linux Mint with QGIS 3.8, it does not work. While importing of photos works (once, with the next import the plugin throws errors), the Viewer does not do anything, but show a tooltip-entry of the feature id. – Bernd V. Jul 5 at 17:13
    • You should consider reporting that, it might be a matter of a missing package in your OS or something that can be added to the plugin. Please remember that open source developers can't cover every usecase, and the plugin might have been developed on windows. – Dror Bogin Jul 26 at 5:25

    Your Answer

    By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

    Not the answer you're looking for? Browse other questions tagged or ask your own question.