| 240 | tree.write(self.output_file) |
| 241 | |
| 242 | def write_gpx(self): |
| 243 | gpx = ET.Element("gpx", version="1.1", creator="GoogleMapsConverter") |
| 244 | for place in self.places: |
| 245 | wpt = ET.SubElement(gpx, "wpt", lat=place['coordinates'].split(',')[1], lon=place['coordinates'].split(',')[0]) |
| 246 | ET.SubElement(wpt, "name").text = place['name'] |
| 247 | ET.SubElement(wpt, "desc").text = place['description'] |
| 248 | tree = ET.ElementTree(gpx) |
| 249 | tree.write(self.output_file) |
| 250 | |
| 251 | def convert(self): |
| 252 | with open(self.input_file, 'r') as file: |