add stuffedarea but with no routing support yet

This commit is contained in:
Laura Klünder 2016-12-27 00:52:22 +01:00
parent 06c14a5750
commit 9a6353e2cb
3 changed files with 18 additions and 1 deletions

View file

@ -168,6 +168,18 @@ class Outside(GeometryMapItemWithLevel):
default_related_name = 'outsides'
class StuffedArea(GeometryMapItemWithLevel):
"""
A slow area with many tables or similar. Avoid it from routing by slowing it a bit down
"""
geomtype = 'polygon'
class Meta:
verbose_name = _('Stuffed Area')
verbose_name_plural = _('Stuffed Areas')
default_related_name = 'stuffedareas'
class Escalator(GeometryMapItemWithLevel):
"""
An escalator area

View file

@ -263,3 +263,7 @@ class LevelGeometries():
for stair in assert_multilinestring(self.stairs):
left.append(stair.parallel_offset(0.15, 'right', join_style=JOIN_STYLE.mitre))
return cascaded_union(left).buffer(0.20, join_style=JOIN_STYLE.mitre, cap_style=CAP_STYLE.flat)
@cached_property
def stuffedareas(self):
return cascaded_union([stuffedarea.geometry for stuffedarea in self.query('stuffedareas')])