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

@ -285,7 +285,8 @@ editor = {
'arealocation': '#0099FF', 'arealocation': '#0099FF',
'escalator': '#FF9900', 'escalator': '#FF9900',
'escalatorslope': '#DD7700', 'escalatorslope': '#DD7700',
'oneway': '#FF00FF' 'oneway': '#FF00FF',
'stuffedarea': '#D9A3A3'
}, },
_line_draw_geometry_style: function(style) { _line_draw_geometry_style: function(style) {
style.stroke = true; style.stroke = true;

View file

@ -168,6 +168,18 @@ class Outside(GeometryMapItemWithLevel):
default_related_name = 'outsides' 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): class Escalator(GeometryMapItemWithLevel):
""" """
An escalator area An escalator area

View file

@ -263,3 +263,7 @@ class LevelGeometries():
for stair in assert_multilinestring(self.stairs): for stair in assert_multilinestring(self.stairs):
left.append(stair.parallel_offset(0.15, 'right', join_style=JOIN_STYLE.mitre)) 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) 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')])