The big picture
Recipe Difficulty: Easy
Python Version: 2.7 or 3.5
Operating System: Any
Images can contain many metadata attributes, depending on the file format and the device that was used to capture the image. Fortunately, most devices will embed GPS information within the photos they take. Using third-party libraries, we will extract GPS coordinates and plot them with Google Earth. This script focuses exclusively on this task, however, the recipe can be easily tweaked to extract all embedded Exchangeable Image File Format (EXIF) metadata in JPEG and TIFF images as well.
Getting started
This recipe requires the installation of two third-party libraries: pillow
and simplekml
. All other libraries used in this script are present in Python's standard library. The pillow
library provides a clean interface to the Python Imaging Library (PIL) and can be used to extract embedded metadata from images:
pip install pillow==4.2.1
Note
To learn more about the pillow
library, visit https://pillow.readthedocs...