Project-OSRM / osrm-backend

Open Source Routing Machine - C++ backend
http://map.project-osrm.org
BSD 2-Clause "Simplified" License
6.26k stars 3.31k forks source link

Return way names in all available languages #4561

Open yuryleb opened 6 years ago

yuryleb commented 6 years ago

There are many countries with several official/unofficial languages and many streets/POI with names assigned for more than one language (name:<lang>). Is it possible to return all them not only the default name by public OSRM interface?

I suppose the StringView type in name-returning methods could be extended for this with a map of string_refs indexed by language code in addition to string_ref field for default name.

This allows OSRM frontends (OSRM Text Instructions as first example) to choose the names with language matched the current user's one and dynamically switch from one language to another also for route ways not for their instructions only.

Also this helps to provide some advanced language-dependent functionality to route directions, say grammatical cases applying to way names.

1ec5 commented 6 years ago

Is it possible to return all them not only the default name by public OSRM interface?

Would it be possible for OSRM to accept a preferred language as an option? Including all the languages could bloat the response.

yuryleb commented 6 years ago

Actually yes, nobody usually asks for route for one language first and for another immediately after :wink:

Then it just requires extending OSRM interface in another place - new optional language parameter for route construction and some simple (but unfortunately implicit) logic to choose name:<language> if available (and also to check for more "general" language if "exact" one was not found previously, that's pt for missing pt-BR) or default name only after.

Anyway OSRM needs to grab names from OSM in all available languages for its data files.

AdiSegev commented 4 years ago

Hi,

I'm using Mapbox on Android, on a Hebrew language device.

I need to use Directions for route navigation, I can see that the announcement/banner instructions returns like this: בעוד 700 רגל, פנה שמאלה לבן גוריון; Ben Gurion. It means that the street name comes with both english and hebrew, separated by semicolon. Mapbox tram told me that's because of the way OSM returns the street names.

Is there any solution for that?

murr999888 commented 3 years ago

In Mapbox Navigation, there really is a problem with playing voice instructions. The main language of the map is not supported by Amazon Polly, but the streets have additional names in the supported language. And they cannot be obtained either in OSRM or in Mapbox Directions. As a result, the instruction either consists of words of two languages ​​and some of the words are not pronounced. Or the instruction is all in one language, but Amazon Polly does not support this language and therefore this instruction is not pronounced at all.

Mapbox Direction often returns a double street name - both in the local language and in English. And that only makes the problem worse as Polly tries to speak all these words.

It would be very useful to have an option for the preferred language of street names: if there is such a name - return it, if not - return the street name in the main language of the map.

github-actions[bot] commented 1 month ago

This issue seems to be stale. It will be closed in 30 days if no further activity occurs.