Check for empty coordinates when we transform to polygon
This commit is contained in:
@@ -45,6 +45,8 @@ def marshall_coordinates(coordinates):
|
|||||||
|
|
||||||
def coordinates_to_polygon(coordinates):
|
def coordinates_to_polygon(coordinates):
|
||||||
"""Convert a Coordinate array coordinates to a PostGIS polygon"""
|
"""Convert a Coordinate array coordinates to a PostGIS polygon"""
|
||||||
|
if not coordinates:
|
||||||
|
return None
|
||||||
coordinates.append(coordinates[0]) # Close the ring
|
coordinates.append(coordinates[0]) # Close the ring
|
||||||
result_coordinates = []
|
result_coordinates = []
|
||||||
for coordinate in coordinates:
|
for coordinate in coordinates:
|
||||||
|
|||||||
Reference in New Issue
Block a user