Skip to content

Railway relations of type multilinestring are not showing in the tiles #934

Closed

Description

@Rub21

I noticed that the vector tiles show only the railways that are of type “way” in the transport_lines layer, but not the railways that are relations - type=multilinestring e.g.,

https://www.openhistoricalmap.org/relation/2835640#map=12/50.4356/3.8433&layers=RD&date=1966-10-31&daterange=1824-01-01,2024-12-31

It seems these were not included since the beginning of the tiler deployment because I could not find any configuration for that.

Ref: https://wiki.openstreetmap.org/wiki/Key:railway?uselang=en

Activity

  1. 1ec5 commented on Dec 24, 2024

    @1ec5
    Member

    FYI it’s much more common to represent a railway as a type=route route=railway relation that contains a railway=* way, though there has been some discussion about using multilinestrings for this purpose (#439 and on the forum).

  2. Rub21 commented on Jan 7, 2025

    @Rub21
    MemberAuthor

    @1ec5 I am a bit confused here, but here is the status of those routes/transport lines:

    RELATION: route=*

    For route=* relations, those objects are being added in the route_lines layer.

    e.g.
    https://www.openhistoricalmap.org/relation/2817567#map=12/50.4009/3.7347&layers=RD&date=1962-09-29&daterange=1960-01-01,2024-12-31

    It seems these relations (now as lines) are not showing in the styles but do exist in the vector tiles:
    https://vtiles.openhistoricalmap.org/#14.03/50.46021/3.70729

    image

    WAY: railway=*

    These objects are being displayed in the transport_lines layer together with highways, aeroways. These objects are also being displayed in the styles.

    https://www.openhistoricalmap.org/way/199461529#map=14/50.4872/3.7209&layers=RD&date=1877-02-11&daterange=1824-01-01,2024-12-31

    image

    RELATION: railway=*

    Relations with the tag railway=* have not been added to the vector tiles yet. Searching in Overpass, there are around 1.5k relations.

    image image

    This is why I open this issue to add the railway=* in a transport_lines or other layer.

    My understanding is that railway=*, whether as relations or ways, refers to infrastructure rails. These can represent many types of rail infrastructure, while route=* refers to the routes that lead to a place. Routes can be formed by railways and highways. am I correct on it?

  3. 1ec5 commented on Jan 7, 2025

    @1ec5
    Member

    Relations with the tag railway=* have not been added to the vector tiles yet. Searching in Overpass, there are around 1.5k relations.

    Specifically, there are about 15,000 multilinestring relations, most of them added in the past few months. Half are tagged as railway=* and the other half are tagged as highway=*. (This differs from OSM, where this relation type is used for something else entirely.)

    If we add these relations to the tiles, only the ones tagged as highway=* or railway=* should go in the transport_lines layer. But rather than a special case, it would be better to handle multilinestrings in the same manner as type=multipolygon or area=yes: that is, consider it a geometry tag but look for other tags that indicate the feature type.

  4. Rub21 commented on Jan 9, 2025

    @Rub21
    MemberAuthor

    Currently, it is not possible to merge different tables into one. The transport_lines and transport_multilines tables come from different sources, way and relation-menbers, and combining them into a single table or view it can be more difficult and require additional effort and considerations.

    I have added in a new layer called transport_multilines , I think it would be much easy just to handle in the style side. the layer contains same columns as the transport_lines layer

    ScreenRecording2025-01-09at11 09 48AM-ezgif com-optimize

    cc. @1ec5 @vknoppkewetzel

  5. 1ec5 commented on Jan 9, 2025

    @1ec5
    Member

    New tile layers inherently require us to maintain duplicative style layers, which could hurt performance. We’ll probably need to make a concerted effort to consolidate other tile/style layers to compensate. This is already an longstanding issue in our styles, but duplicating the highway and railway layers will most likely make it a high priority.

    I don’t think it’ll be possible to combine highway multilinestrings and railway multilinestrings into the same style layer. Railways are currently styled as alternating dashes, but MapLibre doesn’t support data-driven styling for the line-dasharray property: maplibre/maplibre-gl-js#1235. This will also result in a combinatorial explosion of style layers if we need to accurately depict z-stacking, such as bridges going over non-bridges and tunnels going under non-tunnels.

  6. Rub21 commented on Feb 10, 2025

    @Rub21
    MemberAuthor

    I was able to merge the multilines and lines into a single PostgreSQL view . Basically, the relations have been simplified to a single member line, passing all attributes from a transport relation to a member. This way, all objects in the transport_lines layer will be LINESTRING geometries. There are some attributes in the lines layer that could help to understand the source, e.g.

    • Lines that comes from a way

    Image

    • Lines that comes from a relation

    Image

    Currently this is in production : https://vtiles.staging.openhistoricalmap.org/#15.87/50.825185/3.261262

    Here is the comparison between production and staging.

    Image https://staging.openhistoricalmap.org/#map=17/50.825711/3.261711&layers=O&date=1923-01-01&daterange=1923-01-01,2023-12-31
  7. Rub21 commented on Feb 12, 2025

    @Rub21
    MemberAuthor

    The transport lines and multilines ave merge in just one layer, no need to do styling !!

  8. added theissue type on Mar 16, 2025
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

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions