hopefully this helps against the geos errors
This commit is contained in:
parent
ffa5fb382e
commit
056a4ef635
1 changed files with 5 additions and 5 deletions
|
@ -68,12 +68,13 @@ class LevelGeometries:
|
||||||
if columns:
|
if columns:
|
||||||
subtract.extend(columns)
|
subtract.extend(columns)
|
||||||
if subtract:
|
if subtract:
|
||||||
space.geometry = space.geometry.difference(unary_union(subtract)).buffer(0)
|
space.geometry = space.geometry.difference(unary_union(subtract))
|
||||||
|
|
||||||
holes = tuple(h.geometry for h in space.holes.all())
|
holes = tuple(h.geometry for h in space.holes.all())
|
||||||
if holes:
|
if holes:
|
||||||
space.holes_geom = unary_union([h.geometry for h in space.holes.all()])
|
space.holes_geom = unary_union([h.geometry for h in space.holes.all()])
|
||||||
space.walkable_geom = space.geometry.difference(space.holes_geom).buffer(0)
|
space.walkable_geom = space.geometry.difference(space.holes_geom)
|
||||||
|
space.holes_geom = space.geometry.intersection(space.holes_geom)
|
||||||
else:
|
else:
|
||||||
space.holes_geom = empty_geometry_collection
|
space.holes_geom = empty_geometry_collection
|
||||||
space.walkable_geom = space.geometry
|
space.walkable_geom = space.geometry
|
||||||
|
@ -81,10 +82,9 @@ class LevelGeometries:
|
||||||
spaces_geom = unary_union([s.geometry for s in level.spaces.all()])
|
spaces_geom = unary_union([s.geometry for s in level.spaces.all()])
|
||||||
doors_geom = unary_union([d.geometry for d in level.doors.all()])
|
doors_geom = unary_union([d.geometry for d in level.doors.all()])
|
||||||
walkable_spaces_geom = unary_union([s.walkable_geom for s in level.spaces.all()])
|
walkable_spaces_geom = unary_union([s.walkable_geom for s in level.spaces.all()])
|
||||||
geoms.doors = doors_geom.difference(walkable_spaces_geom).buffer(0)
|
geoms.doors = doors_geom.difference(walkable_spaces_geom)
|
||||||
walkable_geom = walkable_spaces_geom.union(geoms.doors)
|
|
||||||
if level.on_top_of_id is None:
|
if level.on_top_of_id is None:
|
||||||
geoms.holes = spaces_geom.difference(walkable_geom).buffer(0)
|
geoms.holes = unary_union([s.holes_geom for s in level.spaces.all()])
|
||||||
|
|
||||||
# keep track which areas are affected by access restrictions
|
# keep track which areas are affected by access restrictions
|
||||||
access_restriction_affected = {}
|
access_restriction_affected = {}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue