Skip to content

Merge street relations into transport_lines #1276

Closed

Description

@1ec5

Similar to #1248, a type=street relation represents a street or highway. It identifies the physical infrastructure but doesn’t represent the physical infrastructure per se and isn’t relevant to routing. Unlike in OSM, a street relation has nothing to do with addressing. Unlike route relations, concurrencies within a given time period are unlikely and probably illogical, but a way may be a member of multiple type=street relations over time.

The tiles should conflate these relations with the member ways to form new linestring features in the transport_lines layer, replacing the member ways’ linestring features. Properties like name would come from the way, falling back to the relation. If the way is a member of multiple relations in different time periods, there would be multiple linestring features. This will allow stylesheets to continue to render streets based on transport_lines without having to consider the interaction between ways and relations.

Street relations are being used as an alternative to multilinestring relations. In principle, a street relation can coexist with route relations, but it probably shouldn’t coexist with multilinestring relations just for everyone’s sanity.

In #94, we had the tile generator expose associatedStreet relation type for a similar purpose, but nothing ever used it, so we eventually removed this support in #1077.

Activity

  1. added theissue type on Feb 1, 2026
  2. Rub21 commented on Feb 3, 2026

    @Rub21
    Member

    I used this query to filter these cases in the db:

    [out:json][timeout:25];
    
    rel
      ["type"="street"]
      ({{bbox}})
      -> .streets;
    
    way(r.streets)
      -> .street_ways;
    
    .streets out body;
    .street_ways out body;
    .street_ways out geom;
    

    I found some way that belong to relationtype=street . eg:

    Way: https://www.openhistoricalmap.org/way/198307560

    Way tags:

    • highway=unclassified
    • name=Canal Street
    • old_name=Fox Street
    • start_date=1797

    Relations:

    Rel 1 – https://www.openhistoricalmap.org/relation/2690127

    • name=Sheridan Avenue
    • start_date=1900
    • type=street

    Rel 2 – https://www.openhistoricalmap.org/relation/2690125

    • name=Canal Street
    • start_date=1828
    • end_date=1900
    • type=street

    Rel 3 – https://www.openhistoricalmap.org/relation/2690126

    • name=Fox Street
    • start_date=1797
    • end_date=1828
    • surface=unpaved
    • type=street

    My understanding is that this would produce three features in transport_lines, one per type=street relation where the way is a member, using the way’s geometry and tags as the base, and then adding street‑level attributes from the relation.

    Feature 1: Way + Rel 1

    • highway=unclassified
    • name=Canal Street
    • old_name=Fox Street
    • start_date=1797
    • street_name=Sheridan Avenue
    • street_start_date=1900
    • street_type=street

    Feature 2: Way + Rel 2

    • highway=unclassified
    • name=Canal Street
    • old_name=Fox Street
    • start_date=1797
    • street_name=Canal Street
    • street_start_date=1828
    • street_end_date=1900
    • street_type=street

    Feature 3: Way + Rel 3

    • highway=unclassified
    • name=Canal Street
    • old_name=Fox Street
    • start_date=1797
    • street_name=Fox Street
    • street_start_date=1797
    • street_end_date=1828
    • street_surface=unpaved
    • street_type=street

    In all three cases, the geometry and primary road tags come from the way, while the street_* fields are derived from the corresponding type=street relation. Is this correct understanding to implement?

  3. 1ec5 commented on Feb 3, 2026

    @1ec5
    MemberAuthor

    That isn’t a great example unfortunately. https://www.openhistoricalmap.org/way/198307560 shouldn’t have any name=* on it because it’s a member of three different street relations with different names. The implementation of this feature request would skip over the way because it’s already named, no need to backfill anything from the street relation.

    These 16 street relations don’t conflict with any member ways’ names. But all of them have matching name=* on the roadways, probably because the mapper didn’t want to see them go unlabeled in the Historical style. None of them contains all unnamed ways. So the implementation would also have no effect on these features.

    These 462 street relations contain some unnamed member ways. For example:

    • This highway=residential way belongs to three different street relations in different time periods. The transport_lines layer should have three overlapping LineString features with similar properties except for start_date, end_date, and name. These three properties would come from the street relations.
    • This highway=primary way belongs to an unnamed street relation in one time period and Wagon Road Trail in another time period. The transport_lines layer should have two overlapping LineString features with similar properties except for start_date, end_date, and name. The street relations are also tagged with conflicting highway=* tags. I’d leave highway=* out of scope for now. The community needs to discuss what to do about primary feature tags that change over time. One approach to that issue is multilinestring relations, which the tile generator already supports.

    If there’s any time period in which the roadway exists but it isn’t part of any street relation, then the properties would come from the way alone. Unlike what we did in #1090 for route relations, I don’t think we need to worry about separate street_name=* or street_1_name=* properties yet, because concurrencies are much rarer.

  4. 1ec5 commented on Feb 23, 2026

    @1ec5
    MemberAuthor

    way https://www.openhistoricalmap.org/way/201849710 the relations https://www.openhistoricalmap.org/relation/2891096 overwrites the start_date

    That’s fine, but there probably still needs to be a transport_lines feature corresponding to the period during which the street existed alone without a street relation. Oak Street did exist between 1915 and 1984, just not as part of a bigger street relation.

  5. Rub21 commented on Feb 23, 2026

    @Rub21
    Member
  6. 1ec5 commented on Feb 23, 2026

    @1ec5
    MemberAuthor

    For Oak Street, there should be one feature for 1915–1984 corresponding to the time period when there was no street relation, then another for 1984–present based on the street relation. There shouldn’t be any overlapping time periods, because that would cause unpredictable behavior in the stylesheet. It’s similar to what we do when a roadway is part of a route relation but the route only exists during part of that roadway’s existence.

  7. Rub21 commented on Feb 24, 2026

    @Rub21
    Member

    Regarding way 201849710 and relation 2891096: I split both the relation and the way so that they appear without any date overlaps.

    Image

    Currently, this emits two separate line features in the tiles. However, both look identical, which unnecessarily increases the tile size. It seems it should only display one feature. To optimize tile size, if the attributes are identical, the script should only consider the one with the oldest date. In cases where the attributes differ (such as name, highway, ref, access, service, ford, electrified, highspeed, usage, railway, aeroway, route, tunnel, bridge, or oneway), a separate way should be considered to display those specific attributes.

    Image
  8. 1ec5 commented on Feb 24, 2026

    @1ec5
    MemberAuthor

    Good point, I hadn’t considered that the attributes would be identical anyways. We should be good to go as long as roadway attributes aren’t getting overridden with different values from street relations, or if they are, as long as the roadway’s value appears somewhere in a different feature with a different time period. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions