Basic destination sign handling.

This first part in our Exit Sign / Destination Sign quest re-wires
the `destination=` and `destination:ref=` tag to the `ref=` tag (in case
it's the highway does not already have a `ref=` tag).

Doing some analysis on both Berlin and San Francisco it looks like this
will add a couple of thousand `ref=` tags that we will announce in guidance.

References:
- https://github.com/Project-OSRM/osrm-backend/issues/2267#issuecomment-214771682
- http://wiki.openstreetmap.org/wiki/Key:destination
- http://wiki.openstreetmap.org/wiki/Proposed_features/Destination_details
This commit is contained in:
Daniel J. Hofmann
2016-04-27 13:24:25 +02:00
committed by Patrick Niklaus
parent 1bb88b374e
commit 4cf94319df
4 changed files with 75 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
local Destination = {}
function Destination.get_destination(way)
local destination = way:get_value_by_key("destination")
local destination_ref = way:get_value_by_key("destination:ref")
-- Assemble destination as: "A59: Düsseldorf, Köln"
-- destination:ref ^ ^ destination
local rv = ""
if destination_ref and destination_ref ~= "" then
rv = rv .. destination_ref
end
if destination and destination ~= "" then
if rv ~= "" then
rv = rv .. ": "
end
rv = rv .. string.gsub(destination, ";", ", ")
end
return rv
end
return Destination