try to fix validity problems in build_for_level

This commit is contained in:
Laura Klünder 2017-12-15 12:35:31 +01:00
parent a7c4475151
commit eb7eac4448

View file

@ -68,12 +68,12 @@ class LevelGeometries:
if columns:
subtract.extend(columns)
if subtract:
space.geometry = space.geometry.difference(unary_union(subtract))
space.geometry = space.geometry.difference(unary_union(subtract)).buffer(0)
holes = tuple(h.geometry for h in space.holes.all())
if holes:
space.holes_geom = unary_union([h.geometry for h in space.holes.all()])
space.walkable_geom = space.geometry.difference(space.holes_geom)
space.walkable_geom = space.geometry.difference(space.holes_geom).buffer(0)
else:
space.holes_geom = empty_geometry_collection
space.walkable_geom = space.geometry