TransWikia.com

Displaying multiple images from same point in QGIS

Geographic Information Systems Asked by Enrico Croce on May 14, 2021

After the dead of eVis plugin I have troubles working on my project in QGIS 3.16:

I have a shapefile with multiple row, each one with the same position: the content is data from archaeological sites and is derived from a query on a spatialite database.
Each row is provided with the path of a picture.

I need to display, in sequence, all the pictures related to the site (with also their data, stored in the single photo row, but that is ok). Until now the eVis browser from eVis plugin was doing exactly this, but now is dead and I cannot find any replacement.

I’ve tried to work on the Attribute Forms in the layer properties, but I can only manage to do the required task (via Identify Features) when there is only one image related to a single position.
With multiple images the Identify Features open a tree form, with the path of the images but not the pictures. I attach two example screenshots from a test project (single and multi image point).

Any idea on how to resolve the problem?

Multi Pictures

Single Picture

One Answer

You can try showing the attribute table in form view, and eventually filtering it to list only visible features (or selected features)

You can show the image using the HTML Widget. In the example below, the (full) path is saved in the field "a" and the expression is, on a single line,

<script>document.write(expression.evaluate("'<img src="' || a  ||'">'"));</script>

To build the path and decorations, you can elaborate such as

<script>document.write(expression.evaluate("'<div>Image: <img src = "file:///'|| photo ||'"  width="300" height="225" alt="Alias Name"/></div>'"));</script>

Please note the 3 slashes for the file:///

enter image description here

Answered by JGH on May 14, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP