[openstreetmap/openstreetmap-website] Fixed motorways being referred to as unnamed roads (#1741)

Jamie Guthrie notifications at github.com
Mon Feb 12 07:31:50 UTC 2018


At the moment, most motorways are listed as unnamed roads.

This is because, for some reason, the OSRM API returns normal road names (i.e. Savile Street) in the `step.name` attribute in the JSON response, however, includes motorway/freeway names (i.e. M1) in the `step.ref` attribute.
Sometimes motorways are named (i.e.  _L'Autoroute du Nord_ heading north out of Paris), however, it would still be useful to have the numeric reference too (in this case, _A1_)

At the moment, the _L'Autoroute du Nord_ out of Paris is referenced just by name (i.e. _"Turn left onto **L'Autoroute du Nord**"_, however, it would be very beneficial when planning routes if the route number is indicated too (i.e. _"Turn left onto **L'Autoroute du Nord (A1)**"_), which this pull request does.

Likewise, the M1 in Britain is an unnamed road, so at the moment directions are in the form of _Turn left onto unnamed road (110km)_, which seems like a massive oversight when referencing a national highway system!
My changes change this so it now says _Turn left onto **M1**_.

In addition, main trunk roads are also referenced by road number too, so "Turn left onto **Tottenham Court Road**" becomes "Turn left onto **Tottenham Court Road (A400)**", which again is very useful for route planning.


_____


I have tested the changes across the USA, Africa, Europe, Japan, China etc, and in all cases times where you are directed along 1000s of kms of unnamed road, it now directs you along 750km of E1 or 300km of N23 for example.
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/1741

-- Commit Summary --

  * Fixed motorways being referred to as unnamed roads

-- File Changes --

    M app/assets/javascripts/index/directions/osrm.js (13)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/1741.patch
https://github.com/openstreetmap/openstreetmap-website/pull/1741.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/1741
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20180212/75a3a0dd/attachment-0001.html>


More information about the rails-dev mailing list