__author__ = "Matt Croydon - http://postneo.com" __version__ = "0.0.6" __license__ = "BSD-like. Don't sue me." __copyright__ = "Copyright (c) 2005 Matt Croydon." class Placemark: "The simplest example from the Keyhole docs (http://www.keyhole.com/kml/kml_doc.html)" def __init__(self, latitude=0.00, longitude=0.00, description="", name="", placerange=600, tilt=0, heading=0): self.latitude = latitude self.longitude = longitude self.description = description # Assume plaintext for now self.name = name self.placerange = placerange self.tilt = tilt self.heading = heading def to_string(self): "An XML representation of the Placemark object." result = "\n"\ "\n"\ " " + self.name + "\n"\ " " + self.description + "\n"\ " \n"\ " " + str(self.longitude) + "\n"\ " " + str(self.latitude) + "\n"\ " " + str(self.placerange) + "\n"\ " " + str(self.tilt) + "\n"\ " " + str(self.heading) + "\n"\ " \n"\ " \n"\ " " + str(self.longitude) + "," + str(self.latitude) + "\n"\ " \n"\ "\n"\ "\n" return result