Random Thoughts

from and to 372433 143758 48 N

Mapping photos 2 (libkml)

April 3rd, 2008 by Melaneum

Few days ago Google release an open source library targeted at KML files: libkml. There is also bindings for python available.

A good opportunity to try it out was to simplify my previous python tagging script.

Using the lib is easy from the examples on Google’s website:

coordinates = factory.CreateCoordinates()
coordinates.add_point3(lon,lat,alt)

to create coordinates for examples. All elements are created and combined together in a kmldom::Document which is passed to a kmldom::Kml then written to a file.

Here is the full script:
jpegtokml.py.

Just run as python jpegtokml.py

Enjoy !

NB: You’ll need to get the libkml cvs version >= r33 for this to work

This entry was posted on Thursday, April 3rd, 2008 at 20:47 CEST and is filed under Geolocation, Python, Tagging, photo. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply