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

ESRI’s File Based Geodatabase and QGIS

With QGIS 3.28.1 being released you get this one new thing that I thought I'd never see. Way back in June (2022) this popped up on twitter: Yes - GDAL 3.6 would have the ability to edit ESRI File Based Geodatabases. Back in 2014 GDAL gained the ability to read an ESRI...

Beck Knob Project

Beck Knob Project

If I ever had to stand behind one thing I've learned as a business and working in Geo - there is no end to free work. A few years ago I had to do a hard stop on volunteer projects and settle on one a year. That one can be one week in length. It can be 6 months. It can...

QGIS Support Redux

Back to QGIS ramblings. I mentioned in a previous blog post I was doing QGIS support specifically for one company but in reality it's been about every client where I install QGIS. The one company turned into a retainer where I tested the waters of "can I do this?"....