Skip to content

Commit

Permalink
Issue #83: add placement tag test.
Browse files Browse the repository at this point in the history
  • Loading branch information
enzet committed Nov 7, 2021
1 parent a60b349 commit 059ffa2
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions tests/test_elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,19 @@
]


# 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
Expand Down Expand Up @@ -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
Expand All @@ -194,3 +199,6 @@ def draw(
ROAD_WIDTHS_AND_FEATURES,
Path("out") / "width.svg",
)
road_features(
ROAD_TYPES, PLACEMENT_FEATURES_1, Path("out") / "placement.svg"
)

0 comments on commit 059ffa2

Please sign in to comment.