Open vknoppkewetzel opened 5 months ago
To elaborate, OSM-based vector tilesets typically union connecting or adjacent ways that share the same attributes. This is more effective if each feature has only the bare minimum properties required for rendering.
One strategy is to split out a separate layer for, say, name
and oneway
, so that the style can render a road using a line layer based on these unioned geometries, plus a symbol layer based on the original geometries. For example, OpenMapTiles has a transportation_name
layer separate from the transportation
layer. This works because breaks in geometry don’t matter as much for labeling. It’s analogous to how we separated a labeling-centric centroid layer from the boundary layer in #701.
The biggest challenge for us is that the start_date
and end_date
properties need to accompany any feature and cannot be split out into a separate layer. Fortunately, MapLibre GL JS can union line features by itself under some conditions, namely for labels when the text-field
property matches. (It can be too aggressive sometimes: mapbox/mapbox-gl-js#3645.) In this case, however, we’re concerned about dash patterns rather than symbols. Moreover, seams at tile boundaries may be unavoidable: mapbox/mapbox-gl-js#5395.
Perhaps we can mitigate the effect of these seams by shrinking the dash pattern or line width. The previous American-style treatment depicting railroad ties also used dash patterns, but I don’t recall the seams being as noticeable at a glance.
Here's a particularly bad example I just came across - maybe a good test case? https://www.openhistoricalmap.org/#map=15/48.7864/9.1825&layers=R&date=1896-05-19&daterange=1800-01-01,2023-12-31
This example also demonstrates that the wider a line becomes, the more likely it is to collide with adjacent lines. This happens easily with highway bridges and their casings as well.
The above also perhaps is a good visual to start using line-gap-width
on rail, although ideally it would be on continuous lines and not segments. We don't use it on road casing because the casing can look ugly on the intentionally segmented pieces - like connecting roads, highway ramps, etc, if we used the gap as casing it would have a line cutting into the road whenever the segment changed.
For rail, mayyyybee this matters less. I'd have to test it... anyway it's worth exploring possibly. BUT it also would only (possibly) aesthetically works if 1 line type isn't segmented a lot (like the OG image above)
What's your idea for a cool feature that would help you use OHM better. Please provide a clear and concise description of the problem you'd like to solve & how you'd like to solve it. Or, the other way around! e.g. I'd like to have the inspector show time-related pictures of the object, so I can get a better idea of what the place was like at the time. https://discord.com/channels/413070382636072960/634106496560398349/1247933951188795443 Per Discord discussion, segmented lines disrupt patterns and cause the pattern to look "messy"
@1ec5 said a solution is that
Current workarounds Is there any way to meet this need using a workaround or "hack" right now? None
Additional info Please add any other context, comparables, screenshots, pictures of drawings on napkins about the feature request here.