shape() method can parse empty geojson
The method was unable to parse empty Polygon
@@ -32,7 +32,10 @@ def shape(context):
elif geom_type == "linestring":
return LineString(ob["coordinates"])
elif geom_type == "polygon":
+ try:
return Polygon(ob["coordinates"][0], ob["coordinates"][1:])
+ except IndexError:
+ return Polygon()
elif geom_type == "multipoint":
return MultiPoint(ob["coordinates"])
elif geom_type == "multilinestring":
