You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Railway relations of type multilinestring are not showing in the tiles #934
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.,
FYI it’s much more common to represent a railway as a type=routeroute=railway relation that contains a railway=* way, though there has been some discussion about using multilinestrings for this purpose (#439 and on the forum).
Relations with the tag railway=* have not been added to the vector tiles yet. Searching in Overpass, there are around 1.5k relations.
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?
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.
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
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.
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.
Activity
1ec5 commentedon Dec 24, 2024
FYI it’s much more common to represent a railway as a
type=routeroute=railwayrelation that contains arailway=*way, though there has been some discussion about using multilinestrings for this purpose (#439 and on the forum).Rub21 commentedon Jan 7, 2025
@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 theroute_lineslayer.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
WAY: railway=*
These objects are being displayed in the
transport_lineslayer 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
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.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, whileroute=*refers to the routes that lead to a place. Routes can be formed by railways and highways. am I correct on it?1ec5 commentedon Jan 7, 2025
Specifically, there are about 15,000
multilinestringrelations, most of them added in the past few months. Half are tagged asrailway=*and the other half are tagged ashighway=*. (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=*orrailway=*should go in thetransport_lineslayer. But rather than a special case, it would be better to handle multilinestrings in the same manner astype=multipolygonorarea=yes: that is, consider it a geometry tag but look for other tags that indicate the feature type.Rub21 commentedon Jan 9, 2025
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 layercc. @1ec5 @vknoppkewetzel
1ec5 commentedon Jan 9, 2025
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-dasharrayproperty: 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.Rub21 commentedon Feb 10, 2025
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.
Currently this is in production : https://vtiles.staging.openhistoricalmap.org/#15.87/50.825185/3.261262
Here is the comparison between production and staging.
Rub21 commentedon Feb 12, 2025
The transport lines and multilines ave merge in just one layer, no need to do styling !!