ZeLonewolf/openstreetmap-americana

Offset one-way arrows away from roads

1ec5 opened this issue · 1 comments

1ec5 commented

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: #512 (comment). 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: #512 (comment) #512 (comment). We tried to mitigate this issue by removing one-way arrows from ramps, but sometimes ramps do benefit from the arrows: #512 (comment).

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 aaroads-wiki#2 (comment). 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

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.