| 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") |