[Python] How to get all coordinates from kml file?

Discussão em 'Python' iniciado por Stack, Novembro 20, 2024.

  1. Stack

    Stack Membro Participativo

    I saved a couple of coordinates from google earth as a kml file. The following code provides me with the coordinates of the first location. Any idea how to get the remaining ones?-I would somehow have to iterate over all locations.

    from pykml import parser
    with open('list.kml', 'r') as f:
    root = parser.parse(f).getroot()
    print(root.Document.Placemark.Point.coordinates)

    Continue reading...

Compartilhe esta Página