Skip to content

Merge railway route relations into transport_lines #1248

Closed

Description

@1ec5

A type=route route=railway relation represents a railway line (as opposed to a passenger train service). It identifies the physical infrastructure but doesn’t represent the physical infrastructure per se, and it isn’t relevant to routing. Concurrencies within a given time period are unlikely and probably illogical, but a way may be a member of multiple route=railway 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 tracks based on transport_lines without having to consider the interaction between ways and relations.

Activity

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

    @Rub21
    Member

    To check my understanding of the proposal:

    I ran this query in overpass

    [out:json][timeout:25];
    
    rel
      ["type"="route"]
      ["route"="railway"]
      ({{bbox}})
      -> .routes;
    
    way(r.routes)
      -> .route_ways;
    
    .route_ways out body;
    .route_ways out geom;
    

    In most cases, I find railway=rail ways that belong to a single type=route + route=railway relation.

    Example way: https://www.openhistoricalmap.org/way/200451888

    Way tags:

    • name=Graham Line
    • railway=rail
    • start_date=1909-01

    This way is a member of relation: https://www.openhistoricalmap.org/relation/2827805

    Relation tags:

    • name=Erie Mainline
    • route=railway
    • type=route

    According to the statement , the vtiles pipeline would generate a single feature in transport_lines for this way, using the way’s geometry and way tags as the base, and then adding line‑level attributes from the relation.

    Way‑derived attributes (higher priority):

    • name=Graham Line
    • class=railway
    • type=rail
    • start_date=1909-01

    Relation‑derived attributes (line‑level):

    • route_name=Erie Mainline
    • route_class=route
    • route_type=railway

    So the resulting transport_lines feature keeps the physical track description from the way, and supplements it with route/line information from the type=route + route=railway relation.

    • What about the case where a way belongs to more than one type=route + route=railway relation? Should this result in duplicated features in transport_lines (one per relation), or is there a preferred way to combine them?

    • If the relation has date tags (for example start_date / end_date ), should these be added to transport_lines as route_start_date and route_end_date?

    • some other relations may have other attributes: operator, network, ref, etc.) that you expect to be consistently propagated into transport_lines?

  3. 1ec5 commented on Feb 3, 2026

    @1ec5
    MemberAuthor

    What about the case where a way belongs to more than one type=route + route=railway relation? Should this result in duplicated features in transport_lines (one per relation), or is there a preferred way to combine them?

    I suspect the answer would be similar to #1276 (comment), but there may be nuances around route=railway semantics that I’m not as familiar with. I’ve asked for some opinions in Discourse Chat and OSMUS Slack.

    some other relations may have other attributes: operator, network, ref, etc.) that you expect to be consistently propagated into transport_lines?

    I’m pretty sure operator=* and ref=* would be of interest in both North America and Europe. We could also look at what OpenRailwayMap is consuming from OSM.

  4. Rub21 commented on Nov 9, 2026

    @Rub21
    Member

    route=railway relations are now part of the transport_lines layer. Each member way keeps its own tags and gets route_name, route_ref and route_operator from the relation. When the relation changes over time, the way gets one feature per relation period.

    e.g:

    https://www.openhistoricalmap.org/way/200451888 - https://vtiles.openhistoricalmap.org/#18/41.455756/-74.11757

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions