Skip to content

Instantly share code, notes, and snippets.

@mohitsingh2806
mohitsingh2806 / kmlToCSV.py
Last active January 9, 2024 08:06
This is a modified version of "https://gist.github.com/mciantyre/32ff2c2d5cd9515c1ee7". I modified it to add functionality to save the Name and description of the placemarks in the KML file along with the coordinates.
from bs4 import BeautifulSoup
import csv
def main():
"""
Open the KML. Read the KML. Make 3 lists for Name, Coordinates and Description of the placemarks. Save the data to a CSV
"""
name_counter = 0
names_list = []
coords_counter = 0