QGIS and Hyperlinks

Aug 21, 2016 | OSGEO, Python, QGIS

It’s funny how things “come up” during the week. I had two people at random go “I wished QGIS did the hyperlink thing that Arcview does”. I hadn’t really thought about the word hyperlinks in a while.

If you ever had the joy of using ArcView 3.x you discovered hyperlinking. You had a field in your shapefile and in that field you had “C:\data\photo.jpeg” or something else. You enabled hyperlinking and then using the “lightening bolt” icon to display the photo. ArcGIS hasn’t changed much – you still have the functionality and you still have the lightening bolt icon to display documents.

Selection_002

QGIS handles documents a bit differently. The end result is the same though. QGIS has actions.

Actions do things. They can open a document,  open a web browser, or run scripts or external programs. If you look at the main interface you’re going to see this gear icon:

Selection_028

If you right click a layer and go to properties, You’ll see the actions tab. There’s a button on the bottom right to create a set of default actions.

Selection_027

If you double click the “Open File” line you can set something up similar to a hyperlink.

Selection_029

If you are on windows if you just put in “open” and insert your field you are good to go. If you had a field named photo your line would look like: open [% “photo” %] .  Windows will open that link with the default program. On linux I’m going to change the type of action to Unix and then actually list out the program used to open a file. For PDF’s I used atril so I put in /usr/bin/atril as opposed to open.

If you click on actions you can then open that document specified in the field…or a URL…or say you have a small custom script that you need to run on one feature when you click on it.

So you do have hyperlinks functionality but it’s a bit different. There are several videos on youtube as this feature  has been around for a while. Good luck – hopefully if you’re googling hyperlinks and qgis you might run into this.

Let’s hope this week someone asks about opening a .e00 file. I’m old and this is where I shine.

You may also like

The Trail Map – Part 1

The Trail Map – Part 1

A few posts ago I babbled about cartography. I've never had the patience for Cartography mainly because two things usually happen...well three things: the map can't be bigger than 8x11 the map must have everything on it Make the map however you want except we will...

My So called Life as a Map Maker

My So called Life as a Map Maker

I can sum it up: It's not much of one. Way back in my younger days I was infatuated with ArcPlot (which was the plotting portion of ArcINFO). From there I moved to Arcview, ArcMap, and eventually here to QGIS. All of my work typically revolves around Data. I usually...

Tricks with an ESRI File Geodatabase

Tricks with an ESRI File Geodatabase

A few years back I jumped in way over my head with QGIS/Postgis. I had moved a process out of one software and into my favorite two (QGIS/PostGIS) and little did I know the final output had to be a ESRI File Geodatabase. So what did I do? I shamed them into using a...