Script: Geotagged Photos to GIS

One of the data deliverables to the NJ National Guard as part of our GIS Internship program is photo and video documentation of the state’s Readiness Centers. There’s even a SDSFIE (a somewhat complicated, cumbersome data schema) entity type specifically for the location where photographs were taken. (Aside: it’s not surprising that “photograph_location_point” is in SDSFIE, because it seems like everything is in SDSFIE.) We have some cameras that have integrated GPS, so we’ve used them for documenting the field work. The problem was, “how do we get geotagged photos into GIS?”

I think it’s somewhat ridiculous that ArcGIS Explorer has the ability to add geotagged photos to the map, but ArcGIS Desktop doesn’t have a built-in means of recognizing geotagged photos. ArcCatalog already examines JPGs it finds for additional information in the case that the JPG is a spatially-aware aerial photo or a rectified map. Even a tool for creating a feature class out of geotagged photos would be great.

Well, ArcToolbox allows you to write your own custom tools through either ModelBuilder (ESRI’s flowchart-based analysis modeling component) or scripts written in Python. I wrote the following script to take a directory of images and for those .JPGs with GPS data in the Exif metadata, create a point feature class containing the spatial location of the photo, along with the photo’s name and complete pathname.

You can download the script (along with a configured tool for use in ArcToolbox) here. The script is GPLv3-licensed. It requires the Python Imaging Library, which takes only a minute or two to install.

I’m pleased with the results. ArcGIS 9.3 recognizes path names in attribute fields and makes them links accessible through the Identify window. You can go from a folder of geotagged pictures to an interactive layer in ArcGIS in under a minute.

If you have any questions about the script, leave them in the comments or email them to me. Also, if you find any bugs (Exif data varies somewhat from camera manufacturer to manufacturer), let me know and I’ll try to squash them.

Happy geotagging!

This entry was posted in Data, ESRI, Visualization and tagged , , , , , . Bookmark the permalink.

8 Responses to Script: Geotagged Photos to GIS

Comments are closed.