MCPcopy Create free account
hub / github.com/comaps/comaps / write_kml

Method write_kml

tools/python/google_maps_bookmarks.py:230–240  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

228 print(f"Couldn't parse {name}: {traceback.format_exc()}")
229
230 def write_kml(self):
231 root = ET.Element("kml")
232 doc = ET.SubElement(root, "Document")
233 for place in self.places:
234 placemark = ET.SubElement(doc, "Placemark")
235 ET.SubElement(placemark, "name").text = place['name']
236 ET.SubElement(placemark, "description").text = place['description']
237 point = ET.SubElement(placemark, "Point")
238 ET.SubElement(point, "coordinates").text = place['coordinates']
239 tree = ET.ElementTree(root)
240 tree.write(self.output_file)
241
242 def write_gpx(self):
243 gpx = ET.Element("gpx", version="1.1", creator="GoogleMapsConverter")

Callers 1

convertMethod · 0.95

Calls 2

ElementMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected