buildgraph: add support for escalator_up and escalator_down

This commit is contained in:
Laura Klünder 2016-12-18 13:28:02 +01:00
parent d2e9e18c2a
commit 405c688eac
5 changed files with 100 additions and 18 deletions

View file

@ -25,6 +25,8 @@ def assert_multipolygon(geometry):
:param geometry: a Polygon or a MultiPolygon
:return: a list of Polygons
"""
if geometry.is_empty:
return []
if isinstance(geometry, Polygon):
return [geometry]
return geometry.geoms
@ -36,6 +38,8 @@ def assert_multilinestring(geometry):
:param geometry: a Geometry or a GeometryCollection
:return: a list of Geometries
"""
if geometry.is_empty:
return []
if isinstance(geometry, LineString):
return [geometry]
return geometry.geoms