Updated shapes parser:

ignore features without geometry
This commit is contained in:
Simon Wüllhorst 2017-09-24 23:20:42 +02:00
parent 07223d6cb6
commit 95b3b20a43

View file

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