stadiamaps / ferrostar

A FOSS navigation SDK built from the ground up for the future
https://stadiamaps.github.io/ferrostar/
Other
180 stars 25 forks source link

Current road name provider #354

Open ianthetechie opened 2 weeks ago

ianthetechie commented 2 weeks ago

Most routing APIs attempt to reduce things to logical maneuvers. To avoid being annoying, they typically don't generate a new maneuver when a road name change happens, but the user continues "straight."

For an example, consider this road in OSM: https://www.openstreetmap.org/way/555210739

When proceeding north, nothing will indicate that the road name changed in a typical Valhalla or OSRM response.

Valhalla offers one possible solution in the trace attributes API which could be used to augment the existing information.

Another option is enabling the developer to specify a tile query for MapLibre to extract the current road name, but this seems problematic as many cases will be ambiguous.

We should come up with an interface that enables users to derive the current road name using some method besides the current method, which is necessarily limited to a (static) name per step.

This can be a trait in the core, with a default implementation provided that looks at the step road name as it does today.

Before deciding on a design, we should look at other APIs and MapLibre code to see if there are better alternatives already.