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

QGIS Offline Help

QGIS Offline Help

Through a long series of events I found myself teaching QGIS in a classroom again. It's been a while. I used to just "hold" classes and sometime during the pandemic I jsut stopped. Occasionally I'll get a call for 3 or 4 people that want training but generally I've...

The online training website that I hardly talk about

The online training website that I hardly talk about

I had mentioned it some but it's probably been coming up on 6 months since I even mentioned training. Right before I decided to attempt to die in 2025 I had started building a training website at training.northrivergeographic.com. Basically it's my Intro to QGIS class...

QGIS Fun: Chickamauga Mound

QGIS Fun: Chickamauga Mound

I've been trying to stop once a week and do something fun with QGIS. Post Heart Incident I do a lot of walking. I've been re-exploring some places I used to go in town to exercise and one is the TN River Walk. I realized the other day I needed to do some OpenStreetMap...