Issue #81: support lane drawing.

This commit is contained in:
Sergey Vartanov 2021-09-15 07:50:55 +03:00
parent cc9826ae57
commit 0a7bead1ca
6 changed files with 97 additions and 15 deletions

View file

@ -29,7 +29,13 @@ from map_machine.icon import (
ShapeSpecification,
)
from map_machine.map_configuration import DrawingMode, MapConfiguration
from map_machine.osm_reader import OSMData, OSMNode, OSMRelation, OSMWay
from map_machine.osm_reader import (
OSMData,
OSMNode,
OSMRelation,
OSMWay,
parse_levels,
)
from map_machine.point import Point
from map_machine.scheme import DEFAULT_COLOR, LineStyle, RoadMatcher, Scheme
from map_machine.text import Label
@ -478,8 +484,7 @@ class Constructor:
def check_level_number(tags: dict[str, Any], level: float) -> bool:
"""Check if element described by tags is no the specified level."""
if "level" in tags:
levels: map = map(float, tags["level"].replace(",", ".").split(";"))
if level not in levels:
if level not in parse_levels(tags["level"]):
return False
else:
return False