On 2018-02-27 19:22, Angela Morley wrote:
I've come across an issue with the current implementation of cardinal directions in roles of relations. In certain areas of the world, roles are being used to determine the cardinal direction of a way in accordance with the AASHTO requirements, however those locales change the official name of the cardinal direction to the name of the direction in their local languages on road signage. Examples include highways in Puerto Rico and Quebec.

Should the tags north, south, east, and west be assigned in these locations according to the official language used on the road signs for those locations (precedent exists like this with Key:name), or should they remain English worldwide, regardless of country?

Given that these values are lowercase, they're best thought of as machine-readable values rather than freeform, human-readable values. So they should remain in English, like any other formal tag value, regardless of the sign's language. Taginfo shows that this has been the case so far in OSM:

<https://taginfo.openstreetmap.org/keys/direction#values> (tags on unidirectional child route relations) <https://taginfo.openstreetmap.org/relations/route#roles> (roles on bidirectional route relations)

This problem has come up in a bug report I was filing with OSRM where they are currently just spitting out values like $north directly into the end user instructions because they don't know what the best way to handle the problem is yet. I had asked for it to be rendered as North, however the question of internationalization came up, and was so valid and pressing I thought it prudent to start a conversation about the topic. ( If you're curious, the original bug report: https://github.com/Project-OSRM/osrm-backend/issues/4918 <https://github.com/Project-OSRM/osrm-backend/issues/4918>)

The OSRM library currently leaves it up to client code to replace the token with something more presentable. For example, the Mapbox Directions API currently replaces these $north tokens with English cardinal directions. It's a known issue that the API doesn't use French and Spanish cardinal directions in Québec and Puerto Rico, respectively, even though the rest of the instructions can be localized.


(Incidentally, this stretch of roadway is a concurrency of US 29 North, US 460 East, and US 501 South.)

Note that the behavior described above applies only to cardinal directions inserted based on route relations. However, most of the time, when you encounter a numbered route in OSRM's guidance instructions, it's due to a human-readable cardinal direction in the destination:ref tag, which is customarily written in the local language. So in Québec, it's currently possible for OSRM-based navigation software to announce an on-ramp onto "A-5 Nord" and then announce a merge onto "A-5 North".


Talk-us mailing list

Reply via email to