Open quincylvania opened 1 year ago
This would surely have been easier if OSM had adopted the convention that link roads are tagged with the lower significance of the two roads that they connect. But that train surely left the station a long time ago.
It's not hard to imagine why the convention evolved how it did- the early designers wanted the ramps to match stylistically with the higher-significance road. Unfortunately there's no tagging that could help us figure out, for a link, what class of road its connected to on the lower-significance side. And, I'm not smart enough to know how to do it in PostGIS.
I think perhaps the diamond markers might be the most workable way to deal with it at this middle zooms.
This would surely have been easier if OSM had adopted the convention that link roads are tagged with the lower significance of the two roads that they connect. But that train surely left the station a long time ago.
If I recall correctly, this convention didn’t receive very much discussion. Basically one mapper wrote up a wiki page that looked very authoritative, some mapping teams picked it up and ran with it, and it was eventually accepted as fact. But even mappers who generally went with the lower classification still usually made an exception for freeway and expressway ramps, which are physically more closely related to the freeway/expressway than the surface street.
Unfortunately there's no tagging that could help us figure out, for a link, what class of road its connected to on the lower-significance side. And, I'm not smart enough to know how to do it in PostGIS.
It would be easy to avoid the barbed-wire effect by hiding all link ways at low zoom levels, but the tradeoff is that there will be gaps at trumpet junctions between freeways.
I agree that postprocessing would be the way forward. For example, most routers have a step that decides whether a link road is a ramp or just a surface street’s turn channel based on the way’s length and shape. Valhalla additionally classifies ramps based on the classification of the road the ramp leads to.
We need to do postprocessing anyways to eliminate duplicate exit numbers; diamond markers can come along for the ride. If we were working with a GeoJSON source, we could probably get away with clustering, but clustering isn’t supported for vector layers: mapbox/mapbox-gl-js#10408.
Could a postprocessing step do something like this? This would be only for low zoom tiles where showing link roads really doesn't make sense at all but we want to avoid gaps.
motorway_link
& trunk_link
segments in each direction until a different highway
class is found.highway
class on both ends is motorway
, change the class of all the link segments to motorway
.highway
class on both ends is trunk
or motorway
on one side and trunk
on the other, change the class of all the link segments to trunk
.By changing these link segments that connect only between motorway
and trunk
it would be possible to omit all link roads at a low zoom level with no gaps. The places where there would have been gaps would have had the link roads changed to their matching main highway
class.
The concept seems reasonable to me, but I don’t know what the relevant portion of the codebase looks like. This issue is focused on freeways (highway=motorway
), but an expressway can also end at a set of freeway-style ramps to other roads.
I think @zekefarwell's algorithm is probably only reasonably doable in planetiler as Java code. I wouldn't even know where to begin to attempt that in SQL. So achievable but not until the next major release of OMT where we can do things in pure code.
I attempted to mitigate this issue in the AARoads Wiki fork by rendering freeway ramps more like surface streets than like the freeways they hang off of: https://github.com/aaroads-wiki/openstreetmap-americana/pull/2#issuecomment-1730544721. I tried to maintain a visual link between freeways at T-interchanges by making them slightly more prominent than surface streets and by keeping them visible at any zoom level in which freeways are visible. Unfortunately, the links are still severed at z8 because OpenMapTiles doesn’t include ramps at all at that zoom level.
On/off ramps show up at zoom 9, but many of the roads they link to aren't visible yet. This leads to a "barbed wire" effect that doesn't look great.
A few options: