Merge branch 'develop' into feature/charts-microservice
This commit is contained in:
@@ -218,14 +218,14 @@ def get_polygons(polygonpms):
|
|||||||
return polygons
|
return polygons
|
||||||
|
|
||||||
def crewnerdify(polygons):
|
def crewnerdify(polygons):
|
||||||
polygons[0].name = "Start"
|
polygon_names = []
|
||||||
polygons[len(polygons)-1].name = "Finish"
|
polygon_names.append("Start")
|
||||||
|
for i in range(1,len(polygons)-1):
|
||||||
|
polygon_name = 'WP{n}'.format(n=polygons[i].order_in_course)
|
||||||
|
polygon_names.append(polygon_name)
|
||||||
|
|
||||||
if len(polygons) > 2:
|
polygon_names.append("Finish")
|
||||||
for i in range(1,len(polygons)-1):
|
return polygon_names
|
||||||
polygons[i].name = 'WP{n}'.format(n=polygons[i].order_in_course)
|
|
||||||
|
|
||||||
return polygons
|
|
||||||
|
|
||||||
def removewhitespace(s):
|
def removewhitespace(s):
|
||||||
regels = s.split('\n')
|
regels = s.split('\n')
|
||||||
@@ -247,13 +247,16 @@ def getcoursefolder(course, document, cn=False):
|
|||||||
polygons = GeoPolygon.objects.filter(
|
polygons = GeoPolygon.objects.filter(
|
||||||
course=course).order_by("order_in_course")
|
course=course).order_by("order_in_course")
|
||||||
|
|
||||||
|
polygon_names = [polygon.name for polygon in polygons]
|
||||||
if cn:
|
if cn:
|
||||||
polygons = crewnerdify(polygons)
|
polygon_names = crewnerdify(polygons)
|
||||||
|
|
||||||
for polygon in polygons:
|
for index, polygon in enumerate(polygons):
|
||||||
placemark = SubElement(folder2, 'Placemark')
|
placemark = SubElement(folder2, 'Placemark')
|
||||||
polygonname = SubElement(placemark, 'name')
|
polygonname = SubElement(placemark, 'name')
|
||||||
polygonname.text = polygon.name
|
polygonname.text = polygon_names[index]
|
||||||
|
polygondescription = SubElement(placemark, 'description')
|
||||||
|
polygondescription.text = polygon.name
|
||||||
polygonstyle = SubElement(placemark, 'styleUrl')
|
polygonstyle = SubElement(placemark, 'styleUrl')
|
||||||
polygonstyle.text = "#default0"
|
polygonstyle.text = "#default0"
|
||||||
p = SubElement(placemark, 'Polygon')
|
p = SubElement(placemark, 'Polygon')
|
||||||
|
|||||||
Reference in New Issue
Block a user