ZeLonewolf / openstreetmap-americana

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

Render traffic signals #795

Open wmisener opened 1 year ago

wmisener commented 1 year ago

Traffic signals are a key part of the road landscape, and it's important for road users using a variety of modes to know which intersections have them. Many city-wide road maps omit them, but smaller-scope neighborhood-level maps can show them. So they would be nice to render at high zoom levels, maybe z>16.

I think the icons should probably be black, which would match the road outlines. The Carto icons are quite oval, which seems very European to me; an American icon would probably be rectangular, as on the road sign:

I think it would be pretty cute to have the red-yellow-green light coloration in the icon, but I'm not sure whether that's stylistically desirable. It would run afoul of the runtime styling implemented in #776, though signals are in a sense more part of the road than part of the POI class anyways.

It might not be possible to nicely implement signal icons currently because roads at high zoom are very thin. Thicker roads which better match the physical width, as suggested in #372, would better accommodate signals and other potential icons that would lie in the roadway, like crosswalks or stop signs.

Unfortunately, I think traffic signals do not currently appear in the OMT tiles.

ZeLonewolf commented 1 year ago

They are not in OMT, so a corresponding ticket should be logged at https://github.com/openmaptiles/openmaptiles

wmisener commented 1 year ago

I've submitted an issue there to add highway=traffic_signals https://github.com/openmaptiles/openmaptiles/issues/1493#issue-1588832442

adamfranco commented 1 year ago

Along with traffic signals I'd like to see stop signs as well.

For both signals and stop signs these may be mapped as a single node at the road intersection or as separate nodes on each approach at the location of the stop-bar marking. I'd think that placing the icons at the mapped location would be fine in either case, rather than trying to coalesce the intersection details into a single point.

ZeLonewolf commented 1 year ago

Let's separate traffic signals from stop signs, especially with regard to the OMT discussion. Traffic signals are rendered in osm-carto so they'd be an easier feature to justify adding.

image

1ec5 commented 1 year ago

For both signals and stop signs these may be mapped as a single node at the road intersection or as separate nodes on each approach at the location of the stop-bar marking. I'd think that placing the icons at the mapped location would be fine in either case, rather than trying to coalesce the intersection details into a single point.

In that case, the style should only show traffic signals at zoom levels where the four signals at an intersection wouldn’t mostly collide each other out, leaving only one signal awkwardly offset from the intersection. This would be a great use case for clustering, but GL JS only supports clustering in GeoJSON sources. Perhaps the clustering can happen on the server side.

ZeLonewolf commented 1 year ago

Server side clustering should be feasible, my only concern would be whether it looks right if the centroid of the cluster isn't dead center in the intersection.

1ec5 commented 1 year ago

That’s true. Some routing engines such as OSRM might have code for making the mapping style more consistent for traffic signals and stop signs. If they rewrite traffic signals from the intersection to the incoming ways, we could go in the other direction.

wmisener commented 1 year ago

Let's separate traffic signals from stop signs, especially with regard to the OMT discussion. Traffic signals are rendered in osm-carto so they'd be an easier feature to justify adding.

Opened a new issue to track stop signs: https://github.com/ZeLonewolf/openstreetmap-americana/issues/796. The exact considerations for things like zoom level and coalescing nodes will likely be different between the two anyways, so it's good to have two issues beyond the OMT discussion. I'm definitely in favor of rendering both signals and stop signs in this style.

1ec5 commented 1 year ago

If we need a monochromatic version of the MUTCD traffic signal glyph, the MUTCD-inspired Australian version is pretty unambiguous, though it would require us to do the coalescing described above:

W3-3