From fa3b49ee75c126590b44db2bb36a99e9aef2751d Mon Sep 17 00:00:00 2001 From: Sergey Vartanov Date: Tue, 29 Sep 2020 01:45:10 +0300 Subject: [PATCH] Remove specific line icons. --- data/tags.yml | 35 ----------------------------------- roentgen/grid.py | 2 +- roentgen/scheme.py | 7 ++----- 3 files changed, 3 insertions(+), 41 deletions(-) diff --git a/data/tags.yml b/data/tags.yml index 1b644bf..0e9d361 100644 --- a/data/tags.yml +++ b/data/tags.yml @@ -712,41 +712,6 @@ node_icons: - tags: {"payment:credit_cards": "yes"} add_icon: [credit_card] -line_icons: - - tags: {building: hotel} - icon: [bed] - - tags: {building: kindergarten} - icon: [toy_horse] - - tags: {building: office} - icon: [briefcase] - - tags: {leisure: playground} - icon: [toy_horse] - - tags: {amenity: ferry_terminal} - icon: [anchor] - - tags: {amenity: parking} - icon: [parking] - - tags: {aeroway: landingpad} - icon: [booster_landing] - - tags: {aeroway: helipad} - icon: [h] - - # Add to everything. - - - tags: {wheelchair: "yes"} - add_icon: [wheelchair] - - tags: {wheelchair: "no"} - add_icon: [no_wheelchair] - - tags: {foot: "yes"} - add_icon: [foot] - - tags: {foot: "no"} - add_icon: [no_foot] - - tags: {bicycle: "yes"} - add_icon: [bicycle] - - tags: {bicycle: "no"} - add_icon: [no_bicycle] - - tags: {access: private} - add_icon: [private] - ways: - tags: {indoor: area} stroke: indoor_border_color diff --git a/roentgen/grid.py b/roentgen/grid.py index e159612..22f2846 100644 --- a/roentgen/grid.py +++ b/roentgen/grid.py @@ -30,7 +30,7 @@ def draw_grid(step: float = 24, columns: int = 16): to_draw: List[Set[str]] = [] - for element in scheme.node_icons + scheme.line_icons: # type: Dict[str, Any] + for element in scheme.icons: # type: Dict[str, Any] if "icon" in element: if set(element["icon"]) not in to_draw: to_draw.append(set(element["icon"])) diff --git a/roentgen/scheme.py b/roentgen/scheme.py index 63393dc..7bd1c28 100644 --- a/roentgen/scheme.py +++ b/roentgen/scheme.py @@ -50,8 +50,7 @@ class Scheme: content: Dict[str, Any] = yaml.load( input_file.read(), Loader=yaml.FullLoader) - self.node_icons: List[Dict[str, Any]] = content["node_icons"] - self.line_icons: List[Dict[str, Any]] = content["line_icons"] + self.icons: List[Dict[str, Any]] = content["node_icons"] self.ways: List[Dict[str, Any]] = content["ways"] @@ -132,9 +131,7 @@ class Scheme: processed: Set[str] = set() fill: Color = DEFAULT_COLOR - rules = self.node_icons if for_ == "node" else self.line_icons - - for matcher in rules: # type: Dict[str, Any] + for matcher in self.icons: # type: Dict[str, Any] matched: bool = True for key in matcher["tags"]: # type: str if key not in tags: