Refactor tag matching; change scheme format.

This commit is contained in:
Sergey Vartanov 2021-05-25 01:36:02 +03:00
parent 3aa0bf841d
commit 796d545cf6
3 changed files with 533 additions and 367 deletions

View file

@ -54,33 +54,34 @@ def draw_all_icons(
if constructed_icon not in icons: if constructed_icon not in icons:
icons.append(constructed_icon) icons.append(constructed_icon)
for group in scheme.icons: for matcher in scheme.node_matchers:
for element in group["tags"]: # type: Dict[str, Any] if matcher.shapes:
for key in ["shapes", "add_shapes"]: current_set = matcher.shapes
if key in element: add()
current_set = element[key] if matcher.add_shapes:
add() current_set = matcher.add_shapes
if "over_icon" not in element: add()
continue if not matcher.over_icon:
if "under_icon" in element: continue
for icon_id in element["under_icon"]: # type: str if matcher.under_icon:
current_set = set([icon_id] + element["over_icon"]) for icon_id in matcher.under_icon:
add() current_set = set([icon_id] + matcher.over_icon)
if not ("under_icon" in element and "with_icon" in element): add()
continue if not (matcher.under_icon and matcher.with_icon):
for icon_id in element["under_icon"]: # type: str continue
for icon_2_id in element["with_icon"]: # type: str for icon_id in matcher.under_icon:
current_set: Set[str] = set( for icon_2_id in matcher.with_icon:
[icon_id] + [icon_2_id] + element["over_icon"]) current_set: Set[str] = set(
add() [icon_id] + [icon_2_id] + matcher.over_icon)
for icon_2_id in element["with_icon"]: # type: str add()
for icon_3_id in element["with_icon"]: # type: str for icon_2_id in matcher.with_icon:
current_set = set( for icon_3_id in matcher.with_icon:
[icon_id] + [icon_2_id] + [icon_3_id] + current_set = set(
element["over_icon"]) [icon_id] + [icon_2_id] + [icon_3_id] +
if (icon_2_id != icon_3_id and icon_2_id != icon_id and matcher.over_icon)
icon_3_id != icon_id): if (icon_2_id != icon_3_id and icon_2_id != icon_id and
add() icon_3_id != icon_id):
add()
specified_ids: Set[str] = set() specified_ids: Set[str] = set()

View file

@ -66,37 +66,119 @@ def is_matched_tag(
return MatchingType.NOT_MATCHED return MatchingType.NOT_MATCHED
def is_matched(matcher: Dict[str, Any], tags: Dict[str, str]) -> bool: class Matcher:
""" def __init__(self, structure: Dict[str, Any]):
Check whether element tags matches tag matcher. self.tags = structure["tags"]
:param matcher: dictionary with tag keys and values, value lists, or "*" self.exception = None
:param tags: element tags to match
"""
matched: bool = True
for config_tag_key in matcher["tags"]: if "exception" in structure:
config_tag_key: str self.exception = structure["exception"]
tag_matcher = matcher["tags"][config_tag_key]
if (
is_matched_tag(config_tag_key, tag_matcher, tags) ==
MatchingType.NOT_MATCHED
):
matched = False
break
if "exception" in matcher: self.replace_shapes: bool = True
for config_tag_key in matcher["exception"]: if "replace_shapes" in structure:
self.replace_shapes = structure["replace_shapes"]
def is_matched(self, tags: Dict[str, str]) -> bool:
"""
Check whether element tags matches tag matcher.
:param tags: element tags to match
"""
matched: bool = True
for config_tag_key in self.tags:
config_tag_key: str config_tag_key: str
tag_matcher = matcher["exception"][config_tag_key] tag_matcher = self.tags[config_tag_key]
if ( if (
is_matched_tag(config_tag_key, tag_matcher, tags) != is_matched_tag(config_tag_key, tag_matcher, tags) ==
MatchingType.NOT_MATCHED MatchingType.NOT_MATCHED
): ):
matched = False matched = False
break break
return matched if self.exception:
for config_tag_key in self.exception:
config_tag_key: str
tag_matcher = self.exception[config_tag_key]
if (
is_matched_tag(config_tag_key, tag_matcher, tags) !=
MatchingType.NOT_MATCHED
):
matched = False
break
return matched
class NodeMatcher(Matcher):
"""
Tag specification matcher.
"""
def __init__(self, structure: Dict[str, Any]):
# Dictionary with tag keys and values, value lists, or "*"
super().__init__(structure)
self.draw: bool = True
if "draw" in structure:
self.draw = structure["draw"]
self.shapes = None
if "shapes" in structure:
self.shapes = structure["shapes"]
self.over_icon = None
if "over_icon" in structure:
self.over_icon = structure["over_icon"]
self.add_shapes = None
if "add_shapes" in structure:
self.add_shapes = structure["add_shapes"]
self.set_main_color = None
if "set_main_color" in structure:
self.set_main_color = structure["set_main_color"]
self.under_icon = None
if "under_icon" in structure:
self.under_icon = structure["under_icon"]
self.with_icon = None
if "with_icon" in structure:
self.with_icon = structure["with_icon"]
class WayMatcher(Matcher):
def __init__(self, structure: Dict[str, Any], colors):
super().__init__(structure)
self.style: Dict[str, Any] = {"fill": "none"}
if "style" in structure:
style: Dict[str, Any] = structure["style"]
for key in style:
if str(style[key]).endswith("_color"):
self.style[key] = colors[style[key]]
else:
self.style[key] = style[key]
self.priority = 0
if "priority" in structure:
self.priority = structure["priority"]
self.r = None
if "r" in structure:
self.r = structure["r"]
self.l = 0
if "r1" in structure:
self.r = structure["r1"]
self.l = 1
if "r2" in structure:
self.r = structure["r2"]
self.l = 2
def get_style(self, scale):
if self.r:
return {**self.style, **{"stroke-width": self.r * scale + self.l}}
else:
return self.style
class Scheme: class Scheme:
@ -112,15 +194,21 @@ class Scheme:
""" """
with file_name.open() as input_file: with file_name.open() as input_file:
content: Dict[str, Any] = yaml.load( content: Dict[str, Any] = yaml.load(
input_file.read(), Loader=yaml.FullLoader) input_file.read(), Loader=yaml.FullLoader
)
self.icons: List[Dict[str, Any]] = content["node_icons"] self.node_matchers: List[NodeMatcher] = []
self.ways: List[Dict[str, Any]] = content["ways"] for group in content["node_icons"]:
for element in group["tags"]:
self.node_matchers.append(NodeMatcher(element))
self.colors: Dict[str, str] = content["colors"] self.colors: Dict[str, str] = content["colors"]
self.area_tags: List[Dict[str, str]] = content["area_tags"] self.way_matchers: List[WayMatcher] = [
WayMatcher(x, self.colors) for x in content["ways"]
]
self.area_matchers: List[Matcher] = [
Matcher(x) for x in content["area_tags"]
]
self.tags_to_write: List[str] = content["tags_to_write"] self.tags_to_write: List[str] = content["tags_to_write"]
self.prefix_to_write: List[str] = content["prefix_to_write"] self.prefix_to_write: List[str] = content["prefix_to_write"]
self.tags_to_skip: List[str] = content["tags_to_skip"] self.tags_to_skip: List[str] = content["tags_to_skip"]
@ -202,49 +290,43 @@ class Scheme:
index: int = 0 index: int = 0
for group in self.icons: for matcher in self.node_matchers:
for matcher in group["tags"]: if not matcher.replace_shapes and main_icon:
matcher: Dict[str, Any] continue
if "replace_shapes" in matcher and main_icon: matched: bool = matcher.is_matched(tags)
continue if not matched:
matched: bool = is_matched(matcher, tags) continue
matcher_tags: Set[str] = matcher["tags"].keys() matcher_tags: Set[str] = set(matcher.tags.keys())
if not matched: priority = len(self.node_matchers) - index
continue if not matcher.draw:
priority = len(self.icons) - index processed |= matcher_tags
if "draw" in matcher and not matcher["draw"]: if matcher.shapes:
processed |= set(matcher_tags) main_icon = Icon([
if "shapes" in matcher: ShapeSpecification.from_structure(x, icon_extractor, self)
main_icon = Icon([ for x in matcher.shapes
ShapeSpecification.from_structure(x, icon_extractor, self) ])
for x in matcher["shapes"] processed |= matcher_tags
]) if matcher.over_icon:
processed |= set(matcher_tags) if main_icon:
if "over_icon" in matcher: main_icon.add_specifications([
if main_icon:
main_icon.add_specifications([
ShapeSpecification.from_structure(
x, icon_extractor, self
)
for x in matcher["over_icon"]
])
for key in matcher_tags:
processed.add(key)
if "add_shapes" in matcher:
extra_icons += [Icon([
ShapeSpecification.from_structure( ShapeSpecification.from_structure(
x, icon_extractor, self, Color("#888888") x, icon_extractor, self
) )
for x in matcher["add_shapes"] for x in matcher.over_icon
])] ])
for key in matcher_tags: processed |= matcher_tags
processed.add(key) if matcher.add_shapes:
if "color" in matcher: extra_icons += [Icon([
assert False ShapeSpecification.from_structure(
if "set_main_color" in matcher: x, icon_extractor, self, Color("#888888")
main_icon.recolor(self.get_color(matcher["set_main_color"])) )
for x in matcher.add_shapes
])]
processed |= matcher_tags
if matcher.set_main_color:
main_icon.recolor(self.get_color(matcher.set_main_color))
index += 1 index += 1
color: Optional[Color] = None color: Optional[Color] = None
@ -288,31 +370,13 @@ class Scheme:
""" """
line_styles = [] line_styles = []
for element in self.ways: # type: Dict[str, Any] for matcher in self.way_matchers:
priority = 0 if not matcher.is_matched(tags):
matched: bool = is_matched(element, tags)
if not matched:
continue continue
style: Dict[str, Any] = {"fill": "none"}
if "priority" in element:
priority = element["priority"]
for key in element: # type: str
if key not in [
"tags", "exception", "priority", "level", "shapes", "r",
"r1", "r2"
]:
value = element[key]
if isinstance(value, str) and value.endswith("_color"):
value = self.get_color(value)
style[key] = value
if "r" in element:
style["stroke-width"] = (element["r"] * scale)
if "r1" in element:
style["stroke-width"] = (element["r1"] * scale + 1)
if "r2" in element:
style["stroke-width"] = (element["r2"] * scale + 2)
line_styles.append(LineStyle(style, priority)) line_styles.append(
LineStyle(matcher.get_style(scale), matcher.priority)
)
return line_styles return line_styles
@ -403,7 +467,7 @@ class Scheme:
""" """
Check whether way described by tags is area. Check whether way described by tags is area.
""" """
for matcher in self.area_tags: for matcher in self.area_matchers:
if is_matched(matcher, tags): if matcher.is_matched(tags):
return True return True
return False return False

View file

@ -729,6 +729,12 @@ node_icons:
{shape: digit_4, offset: [-2, 2]}, {shape: digit_4, offset: [-2, 2]},
{shape: digit_0, offset: [2, 2]}, {shape: digit_0, offset: [2, 2]},
] ]
- tags: {traffic_sign: maxspeed, maxspeed: ".."}
shapes: [
circle_11,
{shape: digit_3, offset: [-2, 0], color: "#FFFFFF"},
{shape: digit_0, offset: [2, 0], color: "#FFFFFF"},
]
- tags: {traffic_sign: stop} - tags: {traffic_sign: stop}
shapes: [stop] shapes: [stop]
- tags: {highway: give_way} - tags: {highway: give_way}
@ -818,470 +824,565 @@ node_icons:
ways: ways:
- tags: {indoor: area} - tags: {indoor: area}
stroke: indoor_border_color style:
stroke-width: 1 stroke: indoor_border_color
fill: indoor_color stroke-width: 1
fill: indoor_color
priority: 10 priority: 10
- tags: {indoor: corridor} - tags: {indoor: corridor}
stroke: indoor_color style:
stroke-width: 1 stroke: indoor_color
fill: indoor_color stroke-width: 1
fill: indoor_color
priority: 11 priority: 11
- tags: {highway: corridor} - tags: {highway: corridor}
stroke: "#00FF00" style:
stroke-width: 5 stroke: "#00FF00"
stroke-width: 5
priority: 11 priority: 11
- tags: {indoor: ["yes", room, elevator], area: "yes"} - tags: {indoor: ["yes", room, elevator], area: "yes"}
stroke: indoor_color style:
stroke-width: 1 stroke: indoor_color
fill: indoor_color stroke-width: 1
fill: indoor_color
priority: 12 priority: 12
- tags: {indoor: column} - tags: {indoor: column}
stroke: indoor_color style:
stroke-width: 1 stroke: indoor_color
fill: indoor_color stroke-width: 1
fill: indoor_color
priority: 13 priority: 13
- tags: {power: line} - tags: {power: line}
stroke: "#000000" style:
stroke-width: 1 stroke: "#000000"
opacity: 0.2 stroke-width: 1
opacity: 0.2
priority: 80 priority: 80
- tags: {power: cable} - tags: {power: cable}
stroke: "#000000" style:
stroke-width: 1 stroke: "#000000"
opacity: 0.1 stroke-width: 1
opacity: 0.1
priority: 80 priority: 80
- tags: {natural: wood} - tags: {natural: wood}
fill: wood_color style:
fill: wood_color
priority: 21 priority: 21
- tags: {natural: wetland} - tags: {natural: wetland}
fill: wetland_color style:
fill: wetland_color
priority: 21 priority: 21
- tags: {natural: grassland} - tags: {natural: grassland}
fill: grass_color style:
stroke: grass_border_color fill: grass_color
stroke: grass_border_color
priority: 20 priority: 20
- tags: {natural: scrub} - tags: {natural: scrub}
fill: wood_color style:
fill: wood_color
priority: 21 priority: 21
- tags: {natural: sand} - tags: {natural: sand}
fill: sand_color style:
fill: sand_color
priority: 20 priority: 20
- tags: {natural: beach} - tags: {natural: beach}
fill: beach_color style:
fill: beach_color
priority: 20 priority: 20
- tags: {natural: desert} - tags: {natural: desert}
fill: desert_color style:
fill: desert_color
priority: 20 priority: 20
- tags: {natural: forest} - tags: {natural: forest}
fill: wood_color style:
fill: wood_color
priority: 21 priority: 21
- tags: {natural: tree_row} - tags: {natural: tree_row}
priority: 21 priority: 21
stroke: wood_color style:
stroke-width: 5 stroke: wood_color
stroke-linecap: round stroke-width: 5
stroke-linejoin: round stroke-linecap: round
stroke-linejoin: round
- tags: {natural: water} - tags: {natural: water}
fill: water_color style:
# stroke: water_border_color fill: water_color
# stroke-width: 1 # stroke: water_border_color
# stroke-width: 1
priority: 21 priority: 21
- tags: {natural: coastline} - tags: {natural: coastline}
# fill: water_color style:
stroke: water_border_color # fill: water_color
stroke-width: 1 stroke: water_border_color
stroke-width: 1
priority: 21 priority: 21
- tags: {natural: ridge} - tags: {natural: ridge}
stroke-width: 2 style:
opacity: 0.3 stroke-width: 2
stroke: ridge_color opacity: 0.3
stroke: ridge_color
priority: 21 priority: 21
- tags: {natural: bare_rock} - tags: {natural: bare_rock}
fill: rock_color style:
fill: rock_color
- tags: {natural: scree} - tags: {natural: scree}
fill: scree_color style:
fill: scree_color
- tags: {landuse: allotments} - tags: {landuse: allotments}
fill: allotments_color style:
fill: allotments_color
priority: 20 priority: 20
- tags: {landuse: conservation} - tags: {landuse: conservation}
fill: grass_color style:
fill: grass_color
priority: 20 priority: 20
- tags: {landuse: construction} - tags: {landuse: construction}
fill: construction_color style:
fill: construction_color
- tags: {landuse: farmland} - tags: {landuse: farmland}
fill: farmland_color style:
fill: farmland_color
stroke: farmland_border_color
priority: 20 priority: 20
stroke: farmland_border_color
- tags: {landuse: forest} - tags: {landuse: forest}
fill: wood_color style:
fill: wood_color
priority: 20 priority: 20
- tags: {landuse: garages} - tags: {landuse: garages}
fill: parking_color style:
fill: parking_color
priority: 21 priority: 21
- tags: {landuse: grass} - tags: {landuse: grass}
fill: grass_color style:
fill: grass_color
stroke: grass_border_color
priority: 20 priority: 20
stroke: grass_border_color
- tags: {landuse: orchard} - tags: {landuse: orchard}
fill: orchard_color style:
fill: orchard_color
priority: 21 priority: 21
- tags: {landuse: meadow} - tags: {landuse: meadow}
fill: meadow_color style:
fill: meadow_color
stroke: meadow_border_color
priority: 20 priority: 20
stroke: meadow_border_color
# Hidden land use # Hidden land use
- tags: {landuse: cemetery} - tags: {landuse: cemetery}
fill: hidden_color style:
opacity: 0.05 fill: hidden_color
opacity: 0.05
- tags: {landuse: commercial} - tags: {landuse: commercial}
fill: hidden_color style:
opacity: 0.05 fill: hidden_color
opacity: 0.05
- tags: {landuse: industrial} - tags: {landuse: industrial}
fill: hidden_color style:
opacity: 0.05 fill: hidden_color
opacity: 0.05
- tags: {landuse: military} - tags: {landuse: military}
fill: hidden_color style:
opacity: 0.05 fill: hidden_color
opacity: 0.05
- tags: {landuse: railway} - tags: {landuse: railway}
fill: hidden_color style:
opacity: 0.05 fill: hidden_color
opacity: 0.05
- tags: {landuse: residential} - tags: {landuse: residential}
fill: hidden_color style:
opacity: 0.05 fill: hidden_color
opacity: 0.05
- tags: {power: substation} - tags: {power: substation}
fill: hidden_color style:
opacity: 0.05 fill: hidden_color
opacity: 0.05
- tags: {building: "*"} - tags: {building: "*"}
fill: building_color style:
stroke: building_border_color fill: building_color
stroke: building_border_color
#- tags: {building:part: "*"} #- tags: {building:part: "*"}
# fill: building_color # fill: building_color
# stroke: building_border_color # stroke: building_border_color
- tags: {amenity: ferry_terminal} - tags: {amenity: ferry_terminal}
fill: ferry_terminal_color style:
priority: 50 fill: ferry_terminal_color
priority: 50
- tags: {amenity: parking} - tags: {amenity: parking}
fill: parking_color style:
opacity: 0.5 fill: parking_color
opacity: 0.5
- tags: {aeroway: landingpad} - tags: {aeroway: landingpad}
fill: "#000000" style:
opacity: 0.1 fill: "#000000"
opacity: 0.1
- tags: {aeroway: helipad} - tags: {aeroway: helipad}
fill: "#440044" style:
opacity: 0.1 fill: "#440044"
opacity: 0.1
- tags: {waterway: riverbank} - tags: {waterway: riverbank}
fill: none # water_color style:
stroke: water_border_color fill: none # water_color
stroke-width: 1 stroke: water_border_color
stroke-width: 1
- tags: {waterway: ditch} - tags: {waterway: ditch}
fill: none # water_color style:
stroke: water_color fill: none # water_color
stroke-width: 2 stroke: water_color
stroke-width: 2
- tags: {railway: subway} - tags: {railway: subway}
stroke-width: 10 style:
stroke: "#DDDDDD" stroke-width: 10
stroke: "#DDDDDD"
priority: 41 priority: 41
- tags: {railway: [rail, narrow_gauge, tram]} - tags: {railway: [rail, narrow_gauge, tram]}
stroke-width: 2 style:
stroke: "#000000" stroke-width: 2
stroke: "#000000"
priority: 43 priority: 43
- tags: {railway: platform} - tags: {railway: platform}
fill: platform_color style:
stroke-width: 1 fill: platform_color
stroke: platform_border_color stroke-width: 1
stroke: platform_border_color
priority: 41 priority: 41
- tags: {highway: motorway} - tags: {highway: motorway}
r2: 15 r2: 15
stroke: road_border_color style:
stroke-linecap: round stroke: road_border_color
stroke-linejoin: round stroke-linecap: round
stroke-linejoin: round
priority: 41 priority: 41
- tags: {highway: trunk} - tags: {highway: trunk}
r2: 13 r2: 13
stroke: road_border_color style:
stroke-linecap: round stroke: road_border_color
stroke-linejoin: round stroke-linecap: round
stroke-linejoin: round
priority: 41 priority: 41
- tags: {highway: primary} - tags: {highway: primary}
r2: 11 r2: 11
stroke: primary_border_color style:
stroke-linecap: round stroke: primary_border_color
stroke-linejoin: round stroke-linecap: round
stroke-linejoin: round
priority: 41.9 priority: 41.9
- tags: {highway: motorway_link} - tags: {highway: motorway_link}
r2: 9 r2: 9
stroke: road_border_color style:
stroke-linecap: round stroke: road_border_color
stroke-linejoin: round stroke-linecap: round
stroke-linejoin: round
priority: 41 priority: 41
- tags: {highway: secondary} - tags: {highway: secondary}
r2: 9 r2: 9
stroke: secondary_border_color style:
stroke-linecap: round stroke: secondary_border_color
stroke-linejoin: round stroke-linecap: round
stroke-linejoin: round
priority: 41.8 priority: 41.8
- tags: {highway: tertiary} - tags: {highway: tertiary}
r2: 7 r2: 7
stroke: tertiary_border_color style:
stroke-linecap: round stroke: tertiary_border_color
stroke-linejoin: round stroke-linecap: round
stroke-linejoin: round
priority: 41.7 priority: 41.7
- tags: {highway: unclassified} - tags: {highway: unclassified}
r2: 5 r2: 5
stroke: road_border_color style:
stroke-linecap: round stroke: road_border_color
stroke-linejoin: round stroke-linecap: round
stroke-linejoin: round
priority: 41 priority: 41
- tags: {highway: residential} - tags: {highway: residential}
r2: 5 r2: 5
stroke: road_border_color style:
stroke-linecap: round stroke: road_border_color
stroke-linejoin: round stroke-linecap: round
stroke-linejoin: round
priority: 41 priority: 41
- tags: {highway: living_street} - tags: {highway: living_street}
r2: 4 r2: 4
stroke: road_border_color style:
stroke-linecap: round stroke: road_border_color
stroke-linejoin: round stroke-linecap: round
stroke-linejoin: round
priority: 41 priority: 41
- tags: {highway: service} - tags: {highway: service}
exception: {service: parking_aisle} exception: {service: parking_aisle}
r2: 3 r2: 3
stroke: road_border_color style:
stroke-linecap: round stroke: road_border_color
stroke-linejoin: round stroke-linecap: round
stroke-linejoin: round
priority: 41 priority: 41
- tags: {highway: service, service: parking_aisle} - tags: {highway: service, service: parking_aisle}
r2: 2 r2: 2
stroke: road_border_color style:
stroke-linecap: round stroke: road_border_color
stroke-linejoin: round stroke-linecap: round
stroke-linejoin: round
priority: 41 priority: 41
- tags: {highway: track} - tags: {highway: track}
stroke-width: 1.5 style:
stroke: track_color stroke-width: 1.5
stroke-linecap: round stroke: track_color
stroke-linejoin: round stroke-linecap: round
stroke-linejoin: round
priority: 41 priority: 41
- tags: {highway: [footway, pedestrian, cycleway]} - tags: {highway: [footway, pedestrian, cycleway]}
exception: {area: "yes"} exception: {area: "yes"}
stroke-width: 3 style:
stroke: foot_border_color stroke-width: 3
stroke-linecap: round stroke: foot_border_color
stroke-linejoin: round stroke-linecap: round
stroke-linejoin: round
priority: 41 priority: 41
- tags: {highway: steps} - tags: {highway: steps}
stroke-width: 6 style:
stroke: foot_border_color stroke-width: 6
stroke-linecap: butt stroke: foot_border_color
stroke-linecap: butt
- tags: {highway: path} - tags: {highway: path}
stroke-width: 3 style:
stroke: foot_border_color stroke-width: 3
stroke: foot_border_color
priority: 41 priority: 41
- tags: {highway: motorway} - tags: {highway: motorway}
r: 15 r: 15
stroke: "#FFFFFF" style:
stroke-linecap: round stroke: "#FFFFFF"
stroke-linejoin: round stroke-linecap: round
stroke-linejoin: round
priority: 42 priority: 42
- tags: {highway: trunk} - tags: {highway: trunk}
r: 13 r: 13
stroke: "#FFFFFF" style:
stroke-linecap: round stroke: "#FFFFFF"
stroke-linejoin: round stroke-linecap: round
stroke-linejoin: round
priority: 42 priority: 42
- tags: {highway: primary} - tags: {highway: primary}
r: 11 r: 11
stroke: primary_color style:
stroke-linecap: round stroke: primary_color
stroke-linejoin: round stroke-linecap: round
stroke-linejoin: round
priority: 42.9 priority: 42.9
- tags: {highway: secondary} - tags: {highway: secondary}
r: 9 r: 9
stroke: secondary_color style:
stroke-linecap: round stroke: secondary_color
stroke-linejoin: round stroke-linecap: round
stroke-linejoin: round
priority: 42.8 priority: 42.8
- tags: {highway: motorway_link} - tags: {highway: motorway_link}
r: 9 r: 9
stroke: "#FFFFFF" style:
stroke-linecap: round stroke: "#FFFFFF"
stroke-linejoin: round stroke-linecap: round
stroke-linejoin: round
priority: 42 priority: 42
- tags: {highway: tertiary} - tags: {highway: tertiary}
r: 7 r: 7
stroke: tertiary_color style:
stroke-linecap: round stroke: tertiary_color
stroke-linejoin: round stroke-linecap: round
stroke-linejoin: round
priority: 42.7 priority: 42.7
- tags: {highway: unclassified} - tags: {highway: unclassified}
r: 5 r: 5
stroke: "#FFFFFF" style:
stroke-linecap: round stroke: "#FFFFFF"
stroke-linejoin: round stroke-linecap: round
stroke-linejoin: round
priority: 42 priority: 42
- tags: {highway: residential} - tags: {highway: residential}
r: 5 r: 5
stroke: "#FFFFFF" style:
stroke-linecap: round stroke: "#FFFFFF"
stroke-linejoin: round stroke-linecap: round
stroke-linejoin: round
priority: 42 priority: 42
- tags: {highway: living_street} - tags: {highway: living_street}
r: 4 r: 4
stroke: "#FFFFFF" style:
stroke-linecap: round stroke: "#FFFFFF"
stroke-linejoin: round stroke-linecap: round
stroke-linejoin: round
priority: 42 priority: 42
- tags: {highway: service} - tags: {highway: service}
exception: {service: parking_aisle} exception: {service: parking_aisle}
r: 3 r: 3
stroke: "#FFFFFF" style:
stroke-linecap: round stroke: "#FFFFFF"
stroke-linejoin: round stroke-linecap: round
stroke-linejoin: round
priority: 42 priority: 42
- tags: {highway: service, service: parking_aisle} - tags: {highway: service, service: parking_aisle}
r: 2 r: 2
stroke: "#FFFFFF" style:
stroke-linecap: round stroke: "#FFFFFF"
stroke-linejoin: round stroke-linecap: round
stroke-linejoin: round
priority: 42 priority: 42
- tags: {highway: [footway, pedestrian]} - tags: {highway: [footway, pedestrian]}
exception: {area: "yes"} exception: {area: "yes"}
stroke-width: 1.5 style:
stroke-dasharray: 7,3 stroke-width: 1.5
stroke-linecap: round stroke-dasharray: 7,3
stroke-linejoin: round stroke-linecap: round
stroke: foot_color stroke-linejoin: round
stroke: foot_color
priority: 42 priority: 42
- tags: {highway: [footway, pedestrian], area: "yes"} - tags: {highway: [footway, pedestrian], area: "yes"}
stroke: none style:
fill: "#DDDDDD" stroke: none
stroke-linecap: round fill: "#DDDDDD"
stroke-linejoin: round stroke-linecap: round
stroke-linejoin: round
priority: -55 # FIXME priority: -55 # FIXME
- tags: {highway: cycleway} - tags: {highway: cycleway}
exception: {area: "yes"} exception: {area: "yes"}
stroke-width: 1 style:
stroke: cycle_color stroke-width: 1
stroke-dasharray: 8,2 stroke: cycle_color
stroke-linecap: butt stroke-dasharray: 8,2
stroke-linecap: butt
priority: 42 priority: 42
- tags: {highway: steps, conveying: "*"} - tags: {highway: steps, conveying: "*"}
stroke-width: 5 style:
stroke-dasharray: 1.5,2 stroke-width: 5
stroke-linecap: butt stroke-dasharray: 1.5,2
stroke: "#888888" stroke-linecap: butt
stroke: "#888888"
priority: 42 priority: 42
- tags: {highway: steps} - tags: {highway: steps}
exception: {conveying: "*"} exception: {conveying: "*"}
stroke-width: 5 style:
stroke-dasharray: 1.5,2 stroke-width: 5
stroke-linecap: butt stroke-dasharray: 1.5,2
stroke: foot_color stroke-linecap: butt
stroke: foot_color
priority: 42 priority: 42
- tags: {highway: path} - tags: {highway: path}
stroke-width: 1.5 style:
stroke-dasharray: 5,3 stroke-width: 1.5
stroke-linecap: butt stroke-dasharray: 5,3
stroke: foot_color stroke-linecap: butt
stroke: foot_color
priority: 42 priority: 42
- tags: {route: ferry} - tags: {route: ferry}
stroke-width: 1 style:
stroke-dasharray: 3,3 stroke-width: 1
stroke-linecap: butt stroke-dasharray: 3,3
stroke: route_color stroke-linecap: butt
stroke: route_color
priority: 42 priority: 42
- tags: {leisure: garden} - tags: {leisure: garden}
fill: grass_color style:
fill: grass_color
priority: 21 priority: 21
- tags: {leisure: park} - tags: {leisure: park}
fill: grass_color style:
opacity: 0.5 fill: grass_color
opacity: 0.5
- tags: {leisure: pitch} - tags: {leisure: pitch}
fill: pitch_color style:
stroke: pitch_border_color fill: pitch_color
stroke-width: 1 stroke: pitch_border_color
stroke-width: 1
priority: 21 priority: 21
- tags: {leisure: track} - tags: {leisure: track}
fill: pitch_color style:
stroke: pitch_border_color fill: pitch_color
stroke-width: 1 stroke: pitch_border_color
stroke-width: 1
priority: 21 priority: 21
- tags: {leisure: fitness_station} - tags: {leisure: fitness_station}
fill: pitch_color style:
stroke: pitch_border_color fill: pitch_color
stroke-width: 1 stroke: pitch_border_color
stroke-width: 1
priority: 21 priority: 21
- tags: {leisure: playground} - tags: {leisure: playground}
fill: playground_color style:
opacity: 0.2 fill: playground_color
opacity: 0.2
priority: 21 priority: 21
- tags: {leisure: swimming_pool} - tags: {leisure: swimming_pool}
fill: water_color style:
stroke: water_border_color fill: water_color
stroke-width: 1 stroke: water_border_color
stroke-width: 1
- tags: {barrier: hedge} - tags: {barrier: hedge}
fill: none style:
stroke: wood_color fill: none
stroke-width: 4 stroke: wood_color
stroke-width: 4
priority: 40 priority: 40
- tags: {barrier: city_wall} - tags: {barrier: city_wall}
fill: none style:
stroke: "#000000" fill: none
stroke-width: 1 stroke: "#000000"
opacity: 0.35 stroke-width: 1
opacity: 0.35
priority: 40 priority: 40
- tags: {barrier: wall} - tags: {barrier: wall}
fill: none style:
stroke: "#000000" fill: none
stroke-width: 1 stroke: "#000000"
opacity: 0.3 stroke-width: 1
opacity: 0.3
priority: 40 priority: 40
- tags: {barrier: [fence, retaining_wall]} - tags: {barrier: [fence, retaining_wall]}
fill: none style:
stroke: "#000000" fill: none
stroke-width: 1 stroke: "#000000"
opacity: 0.25 stroke-width: 1
opacity: 0.25
priority: 40 priority: 40
- tags: {barrier: handrail} - tags: {barrier: handrail}
fill: none style:
stroke: "#000000" fill: none
stroke-width: 1 stroke: "#000000"
opacity: 0.2 stroke-width: 1
opacity: 0.2
priority: 40 priority: 40
- tags: {barrier: kerb} - tags: {barrier: kerb}
fill: none style:
stroke: "#000000" fill: none
stroke-width: 1 stroke: "#000000"
opacity: 0.15 stroke-width: 1
opacity: 0.15
priority: 40 priority: 40
- tags: {border: "*"} - tags: {border: "*"}
stroke: "#FF0000" style:
stroke-width: 0.5 stroke: "#FF0000"
stroke-dasharray: 10,20 stroke-width: 0.5
stroke-dasharray: 10,20
- tags: {"area:highway": "*"} - tags: {"area:highway": "*"}
- tags: {boundary: "*"} - tags: {boundary: "*"}
# stroke: boundary_color # style:
# stroke-width: 0.3 # stroke: boundary_color
# stroke-dasharray: 10,5 # stroke-width: 0.3
# stroke-dasharray: 10,5
priority: 60 priority: 60
area_tags: area_tags: