Private
Public Access
1
0

better explanation of KML

This commit is contained in:
Sander Roosendaal
2018-05-07 21:47:53 +02:00
parent 46b3566da8
commit fb55779a8e
2 changed files with 9 additions and 3 deletions

View File

@@ -108,7 +108,7 @@ def crewnerdcourse(doc):
description = course.findall('.//opengis:description',ns)[0].text
except IndexError:
description = ''
polygonpms = course.findall('.//opengis:Placemark[opengis:Polygon]',ns)
polygons = get_polygons(polygonpms)
@@ -151,7 +151,11 @@ def get_polygons(polygonpms):
def kmltocourse(f):
doc = et.parse(f)
courses = doc.findall('.//opengis:Folder[opengis:Placemark]',ns)
if not courses:
courses = doc.findall('.//opengis:Placemark',ns)
if courses:
return crewnerdcourse(courses)