Updated parser for shapefiles.

geometry collections can be used now, too.
This commit is contained in:
Simon Wüllhorst 2017-09-24 23:04:24 +02:00
parent 8d4021f122
commit 07223d6cb6

View file

@ -7,6 +7,11 @@ class ShapesParser(JsonParser):
def __createShapes__(self): def __createShapes__(self):
shapes = [] shapes = []
if 'features' in self.__jsonData__:
for feature in self.__jsonData__['features']: for feature in self.__jsonData__['features']:
shapes.append(shape(feature['geometry'])) shapes.append(shape(feature['geometry']))
elif 'geometries' in self.__jsonData__:
for geometry in self.__jsonData__['geometries']:
shapes.append(shape(geometry))
return shapes return shapes