Thanks.
The problem I have is that pykml's documentation zeroes in on creating KML files, but has virtually nothing about reading/editing existing files.
---
Edit: Here's some working code:
The problem I have is that pykml's documentation zeroes in on creating KML files, but has virtually nothing about reading/editing existing files.
from os import path kml_file = path.join( \ '../src/pykml/test', \ 'testfiles/google_kml_developers_guide', \ 'complete_tour_example.kml') with open(kml_file) as f: doc = parser.parse(f)I'll read up on lxml, which pykml depends on.
---
Edit: Here's some working code:
import lxml #import pykml from pykml import parser doc=None with open('dummy.kml') as f: doc = parser.parse(f).getroot() for e in doc.Document.Folder.Placemark: coor = e.LineString.coordinates.text.split(',') print(coor)