stimmenfryslan/stimmen/latitude_longitude.py

10 lines
280 B
Python
Raw Normal View History

2018-09-28 16:28:15 +02:00
def reverse_latitude_longitude(rd_multipolygon):
if len(rd_multipolygon) == 2 and tuple(map(type, rd_multipolygon)) == (float, float):
return rd_multipolygon[::-1]
return [
reverse_latitude_longitude(element)
for element in rd_multipolygon
]