Skip to content

Choose shields based on route relations #587

@1ec5

Description

@1ec5

#518 implemented shields in the U.S. and other countries based on parsing the ref=* tag on individual ways and matching the prefix to hard-coded prefixes. Geocoding each way (#44) mitigates cross-contamination between countries and their conflicting prefixes, but it doesn’t address the limitations of way refs.

Way refs are mainly intended for human readability, not machine readability, so there is a significant degree of intentional inconsistency. This will become apparent as soon as this project attempts to expand coverage of the U.S. beyond Interstates and U.S. Routes. In some other countries, the project would need to maintain hard-coded lists of route numbers or other fragile heuristics, as in #159 (comment). Moreover, route concurrencies are very common in some countries, but an approach based on parsing a single number into a single field can’t accommodate routes from different networks.

Route relations are designed to accommodate the basic aspects of highway routes for machine readability. They’re useful even if you don’t intend to depict a wide variety of route networks and shield designs as OSM Americana does. Planetiler supports route relations, though much of the logic that Americana depends on is probably stuck in Planetiler’s OpenMapTiles profile. After migrating to route relations, geocoding should no longer be necessary in general, though it could be useful in a few edge cases. (Asian Highway shields look quite different depending on the country.)

Actual Expected
I-71 shield, missing I-75 shield I-71/I-75 shields, U.S. 42/U.S. 127 shields

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions