From 059ffa28056c351f76a50a765ef1321f948ae107 Mon Sep 17 00:00:00 2001 From: Sergey Vartanov Date: Mon, 8 Nov 2021 00:42:42 +0300 Subject: [PATCH] Issue #83: add placement tag test. --- tests/test_elements.py | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/tests/test_elements.py b/tests/test_elements.py index d246a46..dec3e28 100644 --- a/tests/test_elements.py +++ b/tests/test_elements.py @@ -96,10 +96,19 @@ ROAD_LANES_AND_FEATURES: list[dict[str, str]] = [ ] +# See https://wiki.openstreetmap.org/wiki/Proposed_features/placement + +PLACEMENT_FEATURES_1: list[dict[str, str]] = [ + {"lanes": "1"}, + {"lanes": "2", "placement": "middle_of:1"}, + {"lanes": "4", "placement": "middle_of:2"}, + {"placement": "transition"}, + {"lanes": "3", "placement": "right_of:1"}, # or placement=left_of:2 +] + + class Grid: - """ - Creating map with elements ordered in grid. - """ + """Creating map with elements ordered in grid.""" def __init__(self) -> None: self.x_step: float = 0.0003 @@ -165,11 +174,7 @@ def draw( """Draw map.""" configuration: MapConfiguration = MapConfiguration(level="all") - flinger: Flinger = Flinger( - boundary_box, - 18, - osm_data.equator_length, - ) + flinger: Flinger = Flinger(boundary_box, 18, osm_data.equator_length) svg: Drawing = Drawing(output_path.name, flinger.size) constructor: Constructor = Constructor( osm_data, flinger, SCHEME, SHAPE_EXTRACTOR, configuration @@ -194,3 +199,6 @@ if __name__ == "__main__": ROAD_WIDTHS_AND_FEATURES, Path("out") / "width.svg", ) + road_features( + ROAD_TYPES, PLACEMENT_FEATURES_1, Path("out") / "placement.svg" + )