Jamie's Blog

Lessons from a life of startups, coding, countryside, and kids

PhotoPlanet.py

h1. PhotoPlanet.py README

Jamie Lawrence, 4th August, 2006

This is a small script to “locate” your photos in “Google Earth”:http://earth.google.com/. It takes a GPS tracklog and a collection of photos, and generated a KML or KMZ file that allows Google Earth to pin thumbnails of your photos at the location where they were taken

!http://jamie.ideasasylum.com/notebook/images/35.jpg!

<!–more–>h2. Requirements

h2. Installation

Unzip this directory to any location. Done.

h2. Operation

  • Make sure that your camera and GPS device are synchronised to exactly the same time
  • Make sure that your GPS device is recording a track log whilst you are taking photos
  • Load the tracklog into EasyGPS and save it as a GPX file
  • From a command prompt, call PhotoPlanet as:

python PhotoPlanet.py -g <.gpx file> -p <photo dir> -o <output file> -z

e.g. python PhotoPlanet.py -g test2.gpx -p "E:\Documents and Settings\Jamie\Desktop\Test\test2" -o test2.kmz -z * Omit the -z switch if you just want a KML file (which link to the photos on your hard drive). * Open the generated KML/KMZ file in Google Earth and your photos will be added * An example .kmz file is included so you can see what the output is like

h2. Notes

  • This script makes use of, and includes, the excellent “EXIF.py”:http://home.cfl.rr.com/genecash/digital_camera/EXIF.py. I didn’t write it.
  • The script does NOT write to the photos, so it should be quite safe
  • Having said that, I’m not responsible if it doesn’t work or breaks something

h2. Code

The code is reproduced below for information purposes only. You should download “the full archive”:http://jamie.ideasasylum.com/notebook/file_download/7 which includes all the necessary files, a README (mostly this document), and “example .KMZ file”:http://jamie.ideasasylum.com/notebook/file_download/8.