I needed the city name from a photo, aka Reverse Geocoding …

Python logoas I had a photo where I didn’t know where I had taken it.

I was in a Python class at the time, and thought “this would be a fun side exercise.”

The steps to get the place name was as follows:

  1. Read the image file (photo) and extract the GPS co-ordinates
  2. using ExifRead
  3. Take those GPS co-ordinates and lookup the place name
    using Reverse Geocoder

It was really simple once I knew how.

Some of the diversions which occurred on the way:

  • Reverse Geocoding in Python – How to Convert raw Latitude/Longitude to insightful data with Addresses.
    This looked more complicated and detailed than what I need now.
    (though, street address vis Open Street Map may be useful in the future)
  • GPSPhoto
    I first used GPSPhoto and it worked.  It may be abandonware, which is why I didn’t continue looking at it.


References: