Skip to content

Instantly share code, notes, and snippets.

@colemanm
Last active February 3, 2020 20:45
Show Gist options
  • Save colemanm/5406487 to your computer and use it in GitHub Desktop.
Save colemanm/5406487 to your computer and use it in GitHub Desktop.
Custom action to link to photos within a GIS feature class.

QGIS Open Image Custom Action

Use this guide to link a path name to a feature's photo in the attribute table.

This assumes you have a column in your data containing the full path to the image you'd like to open (in this example, a field called photo_path).

Create Action

  1. Right click feature class → Properties
  2. On Actions tab:
  • Type: Open
  • Name: Open Photo
  • Action: [% "photo_path" %] (select the field from the list and click "insert field")
  1. Add to action list

Open a Photo

With the info window for a feature open, right click the photo_path field and you'll see your custom "Open Photo" action at the bottom. Now photos can be opened with one click from the attribute table using the default system image viewer.

@jescott2
Copy link

For Windows and QGIS 3, try:
[% @project_folder %][% "photo_path" %]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment