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,30 +54,31 @@ 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:
current_set = element[key]
add() add()
if "over_icon" not in element: if matcher.add_shapes:
continue current_set = matcher.add_shapes
if "under_icon" in element:
for icon_id in element["under_icon"]: # type: str
current_set = set([icon_id] + element["over_icon"])
add() add()
if not ("under_icon" in element and "with_icon" in element): if not matcher.over_icon:
continue continue
for icon_id in element["under_icon"]: # type: str if matcher.under_icon:
for icon_2_id in element["with_icon"]: # type: str for icon_id in matcher.under_icon:
current_set = set([icon_id] + matcher.over_icon)
add()
if not (matcher.under_icon and matcher.with_icon):
continue
for icon_id in matcher.under_icon:
for icon_2_id in matcher.with_icon:
current_set: Set[str] = set( current_set: Set[str] = set(
[icon_id] + [icon_2_id] + element["over_icon"]) [icon_id] + [icon_2_id] + matcher.over_icon)
add() add()
for icon_2_id in element["with_icon"]: # type: str for icon_2_id in matcher.with_icon:
for icon_3_id in element["with_icon"]: # type: str for icon_3_id in matcher.with_icon:
current_set = set( current_set = set(
[icon_id] + [icon_2_id] + [icon_3_id] + [icon_id] + [icon_2_id] + [icon_3_id] +
element["over_icon"]) matcher.over_icon)
if (icon_2_id != icon_3_id and icon_2_id != icon_id and if (icon_2_id != icon_3_id and icon_2_id != icon_id and
icon_3_id != icon_id): icon_3_id != icon_id):
add() add()

View file

@ -66,18 +66,30 @@ 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]):
self.tags = structure["tags"]
self.exception = None
if "exception" in structure:
self.exception = structure["exception"]
self.replace_shapes: bool = True
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. Check whether element tags matches tag matcher.
:param matcher: dictionary with tag keys and values, value lists, or "*"
:param tags: element tags to match :param tags: element tags to match
""" """
matched: bool = True matched: bool = True
for config_tag_key in matcher["tags"]: for config_tag_key in self.tags:
config_tag_key: str config_tag_key: str
tag_matcher = matcher["tags"][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
@ -85,10 +97,10 @@ def is_matched(matcher: Dict[str, Any], tags: Dict[str, str]) -> bool:
matched = False matched = False
break break
if "exception" in matcher: if self.exception:
for config_tag_key in matcher["exception"]: for config_tag_key in self.exception:
config_tag_key: str config_tag_key: str
tag_matcher = matcher["exception"][config_tag_key] tag_matcher = self.exception[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
@ -99,6 +111,76 @@ def is_matched(matcher: Dict[str, Any], tags: Dict[str, str]) -> bool:
return matched 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:
""" """
Map style. Map style.
@ -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,47 +290,41 @@ 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]
if "replace_shapes" in matcher and main_icon:
continue continue
matched: bool = is_matched(matcher, tags) matched: bool = matcher.is_matched(tags)
matcher_tags: Set[str] = matcher["tags"].keys()
if not matched: if not matched:
continue continue
priority = len(self.icons) - index matcher_tags: Set[str] = set(matcher.tags.keys())
if "draw" in matcher and not matcher["draw"]: priority = len(self.node_matchers) - index
processed |= set(matcher_tags) if not matcher.draw:
if "shapes" in matcher: processed |= matcher_tags
if matcher.shapes:
main_icon = Icon([ main_icon = Icon([
ShapeSpecification.from_structure(x, icon_extractor, self) ShapeSpecification.from_structure(x, icon_extractor, self)
for x in matcher["shapes"] for x in matcher.shapes
]) ])
processed |= set(matcher_tags) processed |= matcher_tags
if "over_icon" in matcher: if matcher.over_icon:
if main_icon: if main_icon:
main_icon.add_specifications([ main_icon.add_specifications([
ShapeSpecification.from_structure( ShapeSpecification.from_structure(
x, icon_extractor, self x, icon_extractor, self
) )
for x in matcher["over_icon"] for x in matcher.over_icon
]) ])
for key in matcher_tags: processed |= matcher_tags
processed.add(key) if matcher.add_shapes:
if "add_shapes" in matcher:
extra_icons += [Icon([ extra_icons += [Icon([
ShapeSpecification.from_structure( ShapeSpecification.from_structure(
x, icon_extractor, self, Color("#888888") x, icon_extractor, self, Color("#888888")
) )
for x in matcher["add_shapes"] for x in matcher.add_shapes
])] ])]
for key in matcher_tags: processed |= matcher_tags
processed.add(key) if matcher.set_main_color:
if "color" in matcher: main_icon.recolor(self.get_color(matcher.set_main_color))
assert False
if "set_main_color" in matcher:
main_icon.recolor(self.get_color(matcher["set_main_color"]))
index += 1 index += 1
@ -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,147 +824,185 @@ node_icons:
ways: ways:
- tags: {indoor: area} - tags: {indoor: area}
style:
stroke: indoor_border_color stroke: indoor_border_color
stroke-width: 1 stroke-width: 1
fill: indoor_color fill: indoor_color
priority: 10 priority: 10
- tags: {indoor: corridor} - tags: {indoor: corridor}
style:
stroke: indoor_color stroke: indoor_color
stroke-width: 1 stroke-width: 1
fill: indoor_color fill: indoor_color
priority: 11 priority: 11
- tags: {highway: corridor} - tags: {highway: corridor}
style:
stroke: "#00FF00" stroke: "#00FF00"
stroke-width: 5 stroke-width: 5
priority: 11 priority: 11
- tags: {indoor: ["yes", room, elevator], area: "yes"} - tags: {indoor: ["yes", room, elevator], area: "yes"}
style:
stroke: indoor_color stroke: indoor_color
stroke-width: 1 stroke-width: 1
fill: indoor_color fill: indoor_color
priority: 12 priority: 12
- tags: {indoor: column} - tags: {indoor: column}
style:
stroke: indoor_color stroke: indoor_color
stroke-width: 1 stroke-width: 1
fill: indoor_color fill: indoor_color
priority: 13 priority: 13
- tags: {power: line} - tags: {power: line}
style:
stroke: "#000000" stroke: "#000000"
stroke-width: 1 stroke-width: 1
opacity: 0.2 opacity: 0.2
priority: 80 priority: 80
- tags: {power: cable} - tags: {power: cable}
style:
stroke: "#000000" stroke: "#000000"
stroke-width: 1 stroke-width: 1
opacity: 0.1 opacity: 0.1
priority: 80 priority: 80
- tags: {natural: wood} - tags: {natural: wood}
style:
fill: wood_color fill: wood_color
priority: 21 priority: 21
- tags: {natural: wetland} - tags: {natural: wetland}
style:
fill: wetland_color fill: wetland_color
priority: 21 priority: 21
- tags: {natural: grassland} - tags: {natural: grassland}
style:
fill: grass_color fill: grass_color
stroke: grass_border_color stroke: grass_border_color
priority: 20 priority: 20
- tags: {natural: scrub} - tags: {natural: scrub}
style:
fill: wood_color fill: wood_color
priority: 21 priority: 21
- tags: {natural: sand} - tags: {natural: sand}
style:
fill: sand_color fill: sand_color
priority: 20 priority: 20
- tags: {natural: beach} - tags: {natural: beach}
style:
fill: beach_color fill: beach_color
priority: 20 priority: 20
- tags: {natural: desert} - tags: {natural: desert}
style:
fill: desert_color fill: desert_color
priority: 20 priority: 20
- tags: {natural: forest} - tags: {natural: forest}
style:
fill: wood_color fill: wood_color
priority: 21 priority: 21
- tags: {natural: tree_row} - tags: {natural: tree_row}
priority: 21 priority: 21
style:
stroke: wood_color stroke: wood_color
stroke-width: 5 stroke-width: 5
stroke-linecap: round stroke-linecap: round
stroke-linejoin: round stroke-linejoin: round
- tags: {natural: water} - tags: {natural: water}
style:
fill: water_color fill: water_color
# stroke: water_border_color # stroke: water_border_color
# stroke-width: 1 # stroke-width: 1
priority: 21 priority: 21
- tags: {natural: coastline} - tags: {natural: coastline}
style:
# fill: water_color # fill: water_color
stroke: water_border_color stroke: water_border_color
stroke-width: 1 stroke-width: 1
priority: 21 priority: 21
- tags: {natural: ridge} - tags: {natural: ridge}
style:
stroke-width: 2 stroke-width: 2
opacity: 0.3 opacity: 0.3
stroke: ridge_color stroke: ridge_color
priority: 21 priority: 21
- tags: {natural: bare_rock} - tags: {natural: bare_rock}
style:
fill: rock_color fill: rock_color
- tags: {natural: scree} - tags: {natural: scree}
style:
fill: scree_color fill: scree_color
- tags: {landuse: allotments} - tags: {landuse: allotments}
style:
fill: allotments_color fill: allotments_color
priority: 20 priority: 20
- tags: {landuse: conservation} - tags: {landuse: conservation}
style:
fill: grass_color fill: grass_color
priority: 20 priority: 20
- tags: {landuse: construction} - tags: {landuse: construction}
style:
fill: construction_color fill: construction_color
- tags: {landuse: farmland} - tags: {landuse: farmland}
style:
fill: farmland_color fill: farmland_color
priority: 20
stroke: farmland_border_color stroke: farmland_border_color
priority: 20
- tags: {landuse: forest} - tags: {landuse: forest}
style:
fill: wood_color fill: wood_color
priority: 20 priority: 20
- tags: {landuse: garages} - tags: {landuse: garages}
style:
fill: parking_color fill: parking_color
priority: 21 priority: 21
- tags: {landuse: grass} - tags: {landuse: grass}
style:
fill: grass_color fill: grass_color
priority: 20
stroke: grass_border_color stroke: grass_border_color
priority: 20
- tags: {landuse: orchard} - tags: {landuse: orchard}
style:
fill: orchard_color fill: orchard_color
priority: 21 priority: 21
- tags: {landuse: meadow} - tags: {landuse: meadow}
style:
fill: meadow_color fill: meadow_color
priority: 20
stroke: meadow_border_color stroke: meadow_border_color
priority: 20
# Hidden land use # Hidden land use
- tags: {landuse: cemetery} - tags: {landuse: cemetery}
style:
fill: hidden_color fill: hidden_color
opacity: 0.05 opacity: 0.05
- tags: {landuse: commercial} - tags: {landuse: commercial}
style:
fill: hidden_color fill: hidden_color
opacity: 0.05 opacity: 0.05
- tags: {landuse: industrial} - tags: {landuse: industrial}
style:
fill: hidden_color fill: hidden_color
opacity: 0.05 opacity: 0.05
- tags: {landuse: military} - tags: {landuse: military}
style:
fill: hidden_color fill: hidden_color
opacity: 0.05 opacity: 0.05
- tags: {landuse: railway} - tags: {landuse: railway}
style:
fill: hidden_color fill: hidden_color
opacity: 0.05 opacity: 0.05
- tags: {landuse: residential} - tags: {landuse: residential}
style:
fill: hidden_color fill: hidden_color
opacity: 0.05 opacity: 0.05
- tags: {power: substation} - tags: {power: substation}
style:
fill: hidden_color fill: hidden_color
opacity: 0.05 opacity: 0.05
- tags: {building: "*"} - tags: {building: "*"}
style:
fill: building_color fill: building_color
stroke: building_border_color stroke: building_border_color
#- tags: {building:part: "*"} #- tags: {building:part: "*"}
@ -966,37 +1010,46 @@ ways:
# stroke: building_border_color # stroke: building_border_color
- tags: {amenity: ferry_terminal} - tags: {amenity: ferry_terminal}
style:
fill: ferry_terminal_color fill: ferry_terminal_color
priority: 50 priority: 50
- tags: {amenity: parking} - tags: {amenity: parking}
style:
fill: parking_color fill: parking_color
opacity: 0.5 opacity: 0.5
- tags: {aeroway: landingpad} - tags: {aeroway: landingpad}
style:
fill: "#000000" fill: "#000000"
opacity: 0.1 opacity: 0.1
- tags: {aeroway: helipad} - tags: {aeroway: helipad}
style:
fill: "#440044" fill: "#440044"
opacity: 0.1 opacity: 0.1
- tags: {waterway: riverbank} - tags: {waterway: riverbank}
style:
fill: none # water_color fill: none # water_color
stroke: water_border_color stroke: water_border_color
stroke-width: 1 stroke-width: 1
- tags: {waterway: ditch} - tags: {waterway: ditch}
style:
fill: none # water_color fill: none # water_color
stroke: water_color stroke: water_color
stroke-width: 2 stroke-width: 2
- tags: {railway: subway} - tags: {railway: subway}
style:
stroke-width: 10 stroke-width: 10
stroke: "#DDDDDD" stroke: "#DDDDDD"
priority: 41 priority: 41
- tags: {railway: [rail, narrow_gauge, tram]} - tags: {railway: [rail, narrow_gauge, tram]}
style:
stroke-width: 2 stroke-width: 2
stroke: "#000000" stroke: "#000000"
priority: 43 priority: 43
- tags: {railway: platform} - tags: {railway: platform}
style:
fill: platform_color fill: platform_color
stroke-width: 1 stroke-width: 1
stroke: platform_border_color stroke: platform_border_color
@ -1004,54 +1057,63 @@ ways:
- tags: {highway: motorway} - tags: {highway: motorway}
r2: 15 r2: 15
style:
stroke: road_border_color stroke: road_border_color
stroke-linecap: round stroke-linecap: round
stroke-linejoin: round stroke-linejoin: round
priority: 41 priority: 41
- tags: {highway: trunk} - tags: {highway: trunk}
r2: 13 r2: 13
style:
stroke: road_border_color stroke: road_border_color
stroke-linecap: round stroke-linecap: round
stroke-linejoin: round stroke-linejoin: round
priority: 41 priority: 41
- tags: {highway: primary} - tags: {highway: primary}
r2: 11 r2: 11
style:
stroke: primary_border_color stroke: primary_border_color
stroke-linecap: round stroke-linecap: round
stroke-linejoin: round stroke-linejoin: round
priority: 41.9 priority: 41.9
- tags: {highway: motorway_link} - tags: {highway: motorway_link}
r2: 9 r2: 9
style:
stroke: road_border_color stroke: road_border_color
stroke-linecap: round stroke-linecap: round
stroke-linejoin: round stroke-linejoin: round
priority: 41 priority: 41
- tags: {highway: secondary} - tags: {highway: secondary}
r2: 9 r2: 9
style:
stroke: secondary_border_color stroke: secondary_border_color
stroke-linecap: round stroke-linecap: round
stroke-linejoin: round stroke-linejoin: round
priority: 41.8 priority: 41.8
- tags: {highway: tertiary} - tags: {highway: tertiary}
r2: 7 r2: 7
style:
stroke: tertiary_border_color stroke: tertiary_border_color
stroke-linecap: round stroke-linecap: round
stroke-linejoin: round stroke-linejoin: round
priority: 41.7 priority: 41.7
- tags: {highway: unclassified} - tags: {highway: unclassified}
r2: 5 r2: 5
style:
stroke: road_border_color stroke: road_border_color
stroke-linecap: round stroke-linecap: round
stroke-linejoin: round stroke-linejoin: round
priority: 41 priority: 41
- tags: {highway: residential} - tags: {highway: residential}
r2: 5 r2: 5
style:
stroke: road_border_color stroke: road_border_color
stroke-linecap: round stroke-linecap: round
stroke-linejoin: round stroke-linejoin: round
priority: 41 priority: 41
- tags: {highway: living_street} - tags: {highway: living_street}
r2: 4 r2: 4
style:
stroke: road_border_color stroke: road_border_color
stroke-linecap: round stroke-linecap: round
stroke-linejoin: round stroke-linejoin: round
@ -1059,17 +1121,20 @@ ways:
- tags: {highway: service} - tags: {highway: service}
exception: {service: parking_aisle} exception: {service: parking_aisle}
r2: 3 r2: 3
style:
stroke: road_border_color stroke: road_border_color
stroke-linecap: round stroke-linecap: round
stroke-linejoin: round stroke-linejoin: round
priority: 41 priority: 41
- tags: {highway: service, service: parking_aisle} - tags: {highway: service, service: parking_aisle}
r2: 2 r2: 2
style:
stroke: road_border_color stroke: road_border_color
stroke-linecap: round stroke-linecap: round
stroke-linejoin: round stroke-linejoin: round
priority: 41 priority: 41
- tags: {highway: track} - tags: {highway: track}
style:
stroke-width: 1.5 stroke-width: 1.5
stroke: track_color stroke: track_color
stroke-linecap: round stroke-linecap: round
@ -1077,70 +1142,82 @@ ways:
priority: 41 priority: 41
- tags: {highway: [footway, pedestrian, cycleway]} - tags: {highway: [footway, pedestrian, cycleway]}
exception: {area: "yes"} exception: {area: "yes"}
style:
stroke-width: 3 stroke-width: 3
stroke: foot_border_color stroke: foot_border_color
stroke-linecap: round stroke-linecap: round
stroke-linejoin: round stroke-linejoin: round
priority: 41 priority: 41
- tags: {highway: steps} - tags: {highway: steps}
style:
stroke-width: 6 stroke-width: 6
stroke: foot_border_color stroke: foot_border_color
stroke-linecap: butt stroke-linecap: butt
- tags: {highway: path} - tags: {highway: path}
style:
stroke-width: 3 stroke-width: 3
stroke: foot_border_color stroke: foot_border_color
priority: 41 priority: 41
- tags: {highway: motorway} - tags: {highway: motorway}
r: 15 r: 15
style:
stroke: "#FFFFFF" stroke: "#FFFFFF"
stroke-linecap: round stroke-linecap: round
stroke-linejoin: round stroke-linejoin: round
priority: 42 priority: 42
- tags: {highway: trunk} - tags: {highway: trunk}
r: 13 r: 13
style:
stroke: "#FFFFFF" stroke: "#FFFFFF"
stroke-linecap: round stroke-linecap: round
stroke-linejoin: round stroke-linejoin: round
priority: 42 priority: 42
- tags: {highway: primary} - tags: {highway: primary}
r: 11 r: 11
style:
stroke: primary_color stroke: primary_color
stroke-linecap: round stroke-linecap: round
stroke-linejoin: round stroke-linejoin: round
priority: 42.9 priority: 42.9
- tags: {highway: secondary} - tags: {highway: secondary}
r: 9 r: 9
style:
stroke: secondary_color stroke: secondary_color
stroke-linecap: round stroke-linecap: round
stroke-linejoin: round stroke-linejoin: round
priority: 42.8 priority: 42.8
- tags: {highway: motorway_link} - tags: {highway: motorway_link}
r: 9 r: 9
style:
stroke: "#FFFFFF" stroke: "#FFFFFF"
stroke-linecap: round stroke-linecap: round
stroke-linejoin: round stroke-linejoin: round
priority: 42 priority: 42
- tags: {highway: tertiary} - tags: {highway: tertiary}
r: 7 r: 7
style:
stroke: tertiary_color stroke: tertiary_color
stroke-linecap: round stroke-linecap: round
stroke-linejoin: round stroke-linejoin: round
priority: 42.7 priority: 42.7
- tags: {highway: unclassified} - tags: {highway: unclassified}
r: 5 r: 5
style:
stroke: "#FFFFFF" stroke: "#FFFFFF"
stroke-linecap: round stroke-linecap: round
stroke-linejoin: round stroke-linejoin: round
priority: 42 priority: 42
- tags: {highway: residential} - tags: {highway: residential}
r: 5 r: 5
style:
stroke: "#FFFFFF" stroke: "#FFFFFF"
stroke-linecap: round stroke-linecap: round
stroke-linejoin: round stroke-linejoin: round
priority: 42 priority: 42
- tags: {highway: living_street} - tags: {highway: living_street}
r: 4 r: 4
style:
stroke: "#FFFFFF" stroke: "#FFFFFF"
stroke-linecap: round stroke-linecap: round
stroke-linejoin: round stroke-linejoin: round
@ -1148,18 +1225,21 @@ ways:
- tags: {highway: service} - tags: {highway: service}
exception: {service: parking_aisle} exception: {service: parking_aisle}
r: 3 r: 3
style:
stroke: "#FFFFFF" stroke: "#FFFFFF"
stroke-linecap: round stroke-linecap: round
stroke-linejoin: round stroke-linejoin: round
priority: 42 priority: 42
- tags: {highway: service, service: parking_aisle} - tags: {highway: service, service: parking_aisle}
r: 2 r: 2
style:
stroke: "#FFFFFF" stroke: "#FFFFFF"
stroke-linecap: round stroke-linecap: round
stroke-linejoin: round stroke-linejoin: round
priority: 42 priority: 42
- tags: {highway: [footway, pedestrian]} - tags: {highway: [footway, pedestrian]}
exception: {area: "yes"} exception: {area: "yes"}
style:
stroke-width: 1.5 stroke-width: 1.5
stroke-dasharray: 7,3 stroke-dasharray: 7,3
stroke-linecap: round stroke-linecap: round
@ -1167,6 +1247,7 @@ ways:
stroke: foot_color stroke: foot_color
priority: 42 priority: 42
- tags: {highway: [footway, pedestrian], area: "yes"} - tags: {highway: [footway, pedestrian], area: "yes"}
style:
stroke: none stroke: none
fill: "#DDDDDD" fill: "#DDDDDD"
stroke-linecap: round stroke-linecap: round
@ -1174,12 +1255,14 @@ ways:
priority: -55 # FIXME priority: -55 # FIXME
- tags: {highway: cycleway} - tags: {highway: cycleway}
exception: {area: "yes"} exception: {area: "yes"}
style:
stroke-width: 1 stroke-width: 1
stroke: cycle_color stroke: cycle_color
stroke-dasharray: 8,2 stroke-dasharray: 8,2
stroke-linecap: butt stroke-linecap: butt
priority: 42 priority: 42
- tags: {highway: steps, conveying: "*"} - tags: {highway: steps, conveying: "*"}
style:
stroke-width: 5 stroke-width: 5
stroke-dasharray: 1.5,2 stroke-dasharray: 1.5,2
stroke-linecap: butt stroke-linecap: butt
@ -1187,12 +1270,14 @@ ways:
priority: 42 priority: 42
- tags: {highway: steps} - tags: {highway: steps}
exception: {conveying: "*"} exception: {conveying: "*"}
style:
stroke-width: 5 stroke-width: 5
stroke-dasharray: 1.5,2 stroke-dasharray: 1.5,2
stroke-linecap: butt stroke-linecap: butt
stroke: foot_color stroke: foot_color
priority: 42 priority: 42
- tags: {highway: path} - tags: {highway: path}
style:
stroke-width: 1.5 stroke-width: 1.5
stroke-dasharray: 5,3 stroke-dasharray: 5,3
stroke-linecap: butt stroke-linecap: butt
@ -1200,6 +1285,7 @@ ways:
priority: 42 priority: 42
- tags: {route: ferry} - tags: {route: ferry}
style:
stroke-width: 1 stroke-width: 1
stroke-dasharray: 3,3 stroke-dasharray: 3,3
stroke-linecap: butt stroke-linecap: butt
@ -1207,65 +1293,78 @@ ways:
priority: 42 priority: 42
- tags: {leisure: garden} - tags: {leisure: garden}
style:
fill: grass_color fill: grass_color
priority: 21 priority: 21
- tags: {leisure: park} - tags: {leisure: park}
style:
fill: grass_color fill: grass_color
opacity: 0.5 opacity: 0.5
- tags: {leisure: pitch} - tags: {leisure: pitch}
style:
fill: pitch_color fill: pitch_color
stroke: pitch_border_color stroke: pitch_border_color
stroke-width: 1 stroke-width: 1
priority: 21 priority: 21
- tags: {leisure: track} - tags: {leisure: track}
style:
fill: pitch_color fill: pitch_color
stroke: pitch_border_color stroke: pitch_border_color
stroke-width: 1 stroke-width: 1
priority: 21 priority: 21
- tags: {leisure: fitness_station} - tags: {leisure: fitness_station}
style:
fill: pitch_color fill: pitch_color
stroke: pitch_border_color stroke: pitch_border_color
stroke-width: 1 stroke-width: 1
priority: 21 priority: 21
- tags: {leisure: playground} - tags: {leisure: playground}
style:
fill: playground_color fill: playground_color
opacity: 0.2 opacity: 0.2
priority: 21 priority: 21
- tags: {leisure: swimming_pool} - tags: {leisure: swimming_pool}
style:
fill: water_color fill: water_color
stroke: water_border_color stroke: water_border_color
stroke-width: 1 stroke-width: 1
- tags: {barrier: hedge} - tags: {barrier: hedge}
style:
fill: none fill: none
stroke: wood_color stroke: wood_color
stroke-width: 4 stroke-width: 4
priority: 40 priority: 40
- tags: {barrier: city_wall} - tags: {barrier: city_wall}
style:
fill: none fill: none
stroke: "#000000" stroke: "#000000"
stroke-width: 1 stroke-width: 1
opacity: 0.35 opacity: 0.35
priority: 40 priority: 40
- tags: {barrier: wall} - tags: {barrier: wall}
style:
fill: none fill: none
stroke: "#000000" stroke: "#000000"
stroke-width: 1 stroke-width: 1
opacity: 0.3 opacity: 0.3
priority: 40 priority: 40
- tags: {barrier: [fence, retaining_wall]} - tags: {barrier: [fence, retaining_wall]}
style:
fill: none fill: none
stroke: "#000000" stroke: "#000000"
stroke-width: 1 stroke-width: 1
opacity: 0.25 opacity: 0.25
priority: 40 priority: 40
- tags: {barrier: handrail} - tags: {barrier: handrail}
style:
fill: none fill: none
stroke: "#000000" stroke: "#000000"
stroke-width: 1 stroke-width: 1
opacity: 0.2 opacity: 0.2
priority: 40 priority: 40
- tags: {barrier: kerb} - tags: {barrier: kerb}
style:
fill: none fill: none
stroke: "#000000" stroke: "#000000"
stroke-width: 1 stroke-width: 1
@ -1273,12 +1372,14 @@ ways:
priority: 40 priority: 40
- tags: {border: "*"} - tags: {border: "*"}
style:
stroke: "#FF0000" stroke: "#FF0000"
stroke-width: 0.5 stroke-width: 0.5
stroke-dasharray: 10,20 stroke-dasharray: 10,20
- tags: {"area:highway": "*"} - tags: {"area:highway": "*"}
- tags: {boundary: "*"} - tags: {boundary: "*"}
# style:
# stroke: boundary_color # stroke: boundary_color
# stroke-width: 0.3 # stroke-width: 0.3
# stroke-dasharray: 10,5 # stroke-dasharray: 10,5