Geolocating photos on the map

Photos taken with GPS-enabled cameras, including smartphones, store location information in the header of the file, in a format called EXIF tags. These tags are largely based on the same header tags used by the TIFF image standard. In this recipe, we'll use these tags to create locations on a map for some photos and provide links to open them.

Getting ready

You will need to download some sample geotagged photos from https://github.com/GeospatialPython/qgis/blob/gh-pages/photos.zip?raw=true and place them in a directory named photos in your qgis_data directory.

How to do it...

QGIS requires the Python Imaging Library (PIL), which should already be installed with your installation. PIL can parse EXIF tags. We will gather ...

Get QGIS Python Programming Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.