cache space_buffer to improve performance

This commit is contained in:
Laura Klünder 2017-11-18 20:42:19 +01:00
parent 2d735cf7fc
commit e74bdfe614

View file

@ -198,9 +198,10 @@ class AltitudeArea(LevelGeometryMixin, models.Model):
# collect all stairs on this level
for space in level.spaces.all():
space_buffer = space.geometry.buffer(0.001, join_style=JOIN_STYLE.mitre)
for stair in space.stairs.all():
stairs.extend(assert_multilinestring(
stair.geometry.intersection(space.geometry.buffer(0.001, join_style=JOIN_STYLE.mitre))
stair.geometry.intersection(space_buffer)
))
# divide areas using stairs