Jamie's Weblog

Procrastination and utter drivel since 2001!
  • Email
  • Github
  • Linkedin
  • Twitter
  • Rss
  • Home
  • About
  • Archives
  • Publications
Home» Photography » PhotoPlanet.py

PhotoPlanet.py

Posted on August 4, 2006 by Jamie Lawrence in Photography, Projects, Python

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!

h2. Requirements

* Python 2.4 (tested on “ActiveState Python 2.4 for Windows”:http://www.activestate.com/Products/ActivePython/)
* Google Earth (v3 works fine, v4 should also work)
* “EasyGPS”:http://www.topografix.com/ (for generating .gpx files). Free.
* A GPS device (most work with EasyGPS, I used a Garmin 60C)

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.

1 Comment

One comment on “PhotoPlanet.py”

  1. Sergio says:
    September 12, 2006 at 11:18 am

    Great!!
    You save me lots of work.
    I had problems with TimeZone.

    I made some small changes to allow enter TZ in cmd.
    eg. python PhotoPlanet.py -g -p -o -z -t -3 (GMT-3).
    Everything is changed to local time, not GMT.

    53a54,55
    > parser.add_option(“t”, “-timezone”, dest=”TZ”,
    > help=”TimeZone GMT”, metavar=”TZ”)
    62a65
    > difTZ = int(options.TZ)*60*60
    74c77
    < time = mktime(strptime(timeString[0:len(timeString)-1], ”%Y-%m-%dT%H:%M:%S”))—-
    > time = mktime(strptime(timeString[0:len(timeString)-1], ”%Y-%m-%dT%H:%M:%S”))+difTZ

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Contact Me

  • jamie@ideasasylum.com
  • ideasasylum
    • Twitter

Categories

  • BalanceTrackr (2)
  • C# (1)
  • dualpricing.ie (2)
  • hack (1)
  • Java (4)
  • Linux (3)
  • Measure it to change it (1)
  • Parenting (2)
  • Personal (36)
  • Photography (13)
  • Projects (7)
  • Python (3)
  • rant (17)
  • Reviews (20)
  • Ruby on Rails (16)
  • Taskmonifier (1)
  • Tech (1)
  • Tips & Tricks (7)
  • tuesdaypush (1)
  • Uncategorized (877)
  • Useful (3)
  • Weekly Picks (5)
  • Work (2)

Tags

accident barcampcork batteries bizcamp business car copyright depression diy dual pricing eneloop fowadublin fun gallstones git svn hack health ipad iphone lens life material motivation nginx Personal phd photographers photography photos pinterest podcasts quote rails rant renault scenic review rspec ruby sew shutterscouts startups swimming vagrant windows wrap

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org

(c) 2012 Jamie's Weblog