return name and reference separately

This commit is contained in:
karenzshea
2016-09-05 09:01:51 -04:00
committed by Moritz Kobitzsch
parent 938dff011f
commit dcc1b5ab2b
29 changed files with 131 additions and 74 deletions
+7 -6
View File
@@ -211,19 +211,20 @@ function way_function (way, result)
local bicycle = way:get_value_by_key("bicycle")
-- name
if ref and "" ~= ref and name and "" ~= name then
result.name = name .. " (" .. ref .. ")"
elseif ref and "" ~= ref then
result.name = ref
elseif name and "" ~= name then
if name and "" ~= name then
result.name = name
-- TODO find a better solution for encoding way type
elseif fallback_names and highway then
-- if no name exists, use way type
-- this encoding scheme is excepted to be a temporary solution
-- this encoding scheme is expected to be a temporary solution
result.name = "{highway:"..highway.."}"
end
-- ref
if ref and "" ~= ref then
result.ref = ref
end
-- roundabout handling
if junction and "roundabout" == junction then
result.roundabout = true
+5 -9
View File
@@ -387,14 +387,14 @@ function way_function (way, result)
local has_name = name and "" ~= name
local has_pronunciation = pronunciation and "" ~= pronunciation
if has_name and has_ref then
result.name = name .. " (" .. ref .. ")"
elseif has_ref then
result.name = ref
elseif has_name then
if has_name then
result.name = name
end
if has_ref then
result.ref = ref
end
if has_pronunciation then
result.pronunciation = pronunciation
end
@@ -456,10 +456,6 @@ function way_function (way, result)
local destination = get_destination(way)
local has_destination = destination and "" ~= destination
if has_destination and has_name and not has_ref then
result.name = name .. " (" .. destination .. ")"
end
result.destinations = destination
end
end
+4 -5
View File
@@ -150,16 +150,15 @@ function way_function (way, result)
local surface = way:get_value_by_key("surface")
-- name
if ref and "" ~= ref and name and "" ~= name then
result.name = name .. " (" .. ref .. ")"
elseif ref and "" ~= ref then
result.name = ref
elseif name and "" ~= name then
if name and "" ~= name then
result.name = name
elseif highway and fallback_names then
result.name = "{highway:"..highway.."}" -- if no name exists, use way type
-- this encoding scheme is excepted to be a temporary solution
end
if ref and "" ~= ref then
result.ref = ref
end
-- roundabouts
if "roundabout" == junction then