GIS Quick Tip – Create an “action” in QGIS

Just found this in QGIS and have had a quick play and really like the way it functions, so wanted to share it with everyone. It’s early days, so once I get to grips with it I will post something a bit more descriptive.

QGIS has Attribute Actions where an action can be performed that uses the value of a feature’s attribute, e.g. opening a pdf or image of an asset. It is possible to run queries or python scripts and capture the results. I’m going to add an action to the Named Place layer that performs a Google search on the location’s name:-

  1. Right click on the layer in the Layer Properties panel.
  2. Select Properties to open the Properties dialogue box
  3. Select the Actions tab:-
    1. Select the action type; in this case it’s Generic
    2. Name the action
    3. Enter the details of the action. I need to add the path to the web browser wrapped in speech marks. I then need to leave a space and then add the URL to be opened wrapped in speech marks.
    4. Press the Insert Field button to add a fieldname to the action.
    5. The final text should read: “C:/Program Files/Internet Explorer/iexplore.exe” “http://google.com/search?q=%5B% “NAME” %]“
  4. Click the Add to Action List button.

QGIS Layer Actions dialogue

To run the action for a feature, use the information tool to select a feature from the layer; and then select the Action from Identify results pop up:-

QGIS Layer Actions dialogue

Existing actions can be updated by selecting the action and pressing the update selected Action button

2 thoughts on “GIS Quick Tip – Create an “action” in QGIS

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s