Read GPS tags from EXIF metadata from JPEGs
Bas den Brok - mapping course



Some understanding of Python required.


We want to read the EXIF metadata part of JPG or JPEG files to see these metadata and especially see the GPS data (latitude, lonngitude, elevation) and to convert degrees, minutes and seconds of latitude and longitude to decimal values

See for EXIF (Exchangeable image file format) e.g. here: https://en.wikipedia.org/wiki/Exif
about geotagging here: https://en.wikipedia.org/wiki/Geotagged_photograph
and of course you can find ready applications on the web such as https://exifdata.com to do it for you, but we wanted to do it ourselves.

This is the code: readexif1.py (not for use but to help write it yourself)

We use the PIL module for Python from https://en.wikipedia.org/wiki/Python_Imaging_Library


Name of the JPG-file is in line 47.


Screen output. It is easy for you to write relevant data to a txt-file