better explanation of KML
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user