Reader small image

You're reading from  Learning Geospatial Analysis with Python - Third Edition

Product typeBook
Published inSep 2019
Reading LevelIntermediate
PublisherPackt
ISBN-139781789959277
Edition3rd Edition
Languages
Tools
Right arrow
Author (1)
Joel Lawhead
Joel Lawhead
author image
Joel Lawhead

Joel Lawhead is a PMI-certified Project Management Professional (PMP), a certified GIS Professional (GISP), and vice president of NVision Solutions, Inc., an award-winning firm specializing in geospatial technology integration and sensor engineering for NASA, FEMA, NOAA, the US Navy, and many other commercial and non-profit organizations. Joel began using Python in 1997 and started combining it with geospatial software development in 2000. He has authored multiple editions of Learning Geospatial Analysis with Python and QGIS Python Programming Cookbook, both from Packt. He is also the developer of the open source Python Shapefile Library (PyShp) and maintains a geospatial technical blog.
Read more about Joel Lawhead

Right arrow

Geolocating photos

Photos that are 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 based largely on the same header tags that are used by the TIFF image standard. In this example, we'll use those tags to create a shapefile with point locations for the photos, and file paths to the photos, as attributes.

We’ll use the PIL in this example because it has the ability to extract EXIF data. Most photos that are taken with smartphones are geotagged images; however, you can download the set used in this example from https://git.io/vczR0:

  1. First, we'll import the libraries that we need, including PIL for the image metadata and PyShp for the shapefiles:
import glob
import os
try:
import Image
import ImageDraw
except ImportError:
from PIL import Image
from PIL.ExifTags...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Learning Geospatial Analysis with Python - Third Edition
Published in: Sep 2019Publisher: PacktISBN-13: 9781789959277

Author (1)

author image
Joel Lawhead

Joel Lawhead is a PMI-certified Project Management Professional (PMP), a certified GIS Professional (GISP), and vice president of NVision Solutions, Inc., an award-winning firm specializing in geospatial technology integration and sensor engineering for NASA, FEMA, NOAA, the US Navy, and many other commercial and non-profit organizations. Joel began using Python in 1997 and started combining it with geospatial software development in 2000. He has authored multiple editions of Learning Geospatial Analysis with Python and QGIS Python Programming Cookbook, both from Packt. He is also the developer of the open source Python Shapefile Library (PyShp) and maintains a geospatial technical blog.
Read more about Joel Lawhead