cache space_buffer to improve performance
@@ -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
