osm-americana / openstreetmap-americana

A quintessentially American map style
https://americanamap.org
Creative Commons Zero v1.0 Universal
183 stars 59 forks source link

Offset one-way arrows away from roads #992

Open 1ec5 opened 1 year ago

1ec5 commented 1 year ago

This style currently tries very hard to superimpose one-way arrows on roads. While we should make use of the space within a filled road, we’re running into a lot of problems, especially when the road is only nominally filled.

For example, the arrows at zoom level 15 on local roads and especially alleys gets almost buried in the road casing, making it more difficult to discern the arrow’s direction: https://github.com/ZeLonewolf/openstreetmap-americana/pull/512#issuecomment-1597629098. Meanwhile, we’ve had to invert the arrow’s color on some darker filled roads, but neither black nor white will yield much contrast against a red road or a road that happens to intersect or pass under: https://github.com/ZeLonewolf/openstreetmap-americana/pull/512#issuecomment-1193495684 https://github.com/ZeLonewolf/openstreetmap-americana/pull/512#issuecomment-1200311309. We tried to mitigate this issue by removing one-way arrows from ramps, but sometimes ramps do benefit from the arrows: https://github.com/ZeLonewolf/openstreetmap-americana/pull/512#issuecomment-1273759489.

Many print maps avoid filling roads even at high zoom levels, so they have to account for collisions between stroked roads and one-way arrows. They typically deconflict the arrows in the same manner as road name labels, by offsetting them to one side of the roadway. Though this treatment takes up more space, it ensures the arrows’ legibility and allows for them to be styled more consistently.

MNDOT 2019 American Map New York City

I implemented offset one-way arrows in the AARoads Wiki fork in https://github.com/aaroads-wiki/openstreetmap-americana/pull/2#issuecomment-1732549849. Overall, I think it reinforces the aesthetic that we’re going for with the road name labels. One downside is that it highlights the idiosyncratic arrow placement along these roadway lines, but I think that’s partly because the tiles aren’t merging roadways aggressively enough (onthegomap/planetiler#298) and don’t contain feature IDs that MapLibre can use to join features across tile boundaries (onthegomap/planetiler#377).

OSM Americana AARoads Wiki
Interior arrows Exterior arrows
1ec5 commented 1 year ago

Ideally, the offset would be away from the median of the road even if the road is divided. But this requires knowledge of which side of the road people drive on in a given region. For now, I think it’s OK-ish to assume driving on the right, but this means the one-way arrows will mush together or even overlap the roadway if it’s divided in a region that drives on the left. I don’t know of a good way around this issue unless we incorporate a crude GeoJSON of the countries that drive on the left.