Add cycle_network_ref legacy

This commit is contained in:
Pieter Vander Vennet 2020-09-02 13:24:03 +02:00
parent a164a807cf
commit 153f30f381
3 changed files with 8 additions and 2 deletions

View file

@ -53,7 +53,7 @@ namespace AspectedRouting.IO.itinero1
"normalize = false", "normalize = false",
"vehicle_type = {" + string.Join(", ", _profile.VehicleTyps.Select(s => "\"" + s + "\"")) + "}", "vehicle_type = {" + string.Join(", ", _profile.VehicleTyps.Select(s => "\"" + s + "\"")) + "}",
// meta_whitelist is defined in the profile file, these are tags that are included in the generated route, but are not relevant for determining weights // meta_whitelist is defined in the profile file, these are tags that are included in the generated route, but are not relevant for determining weights
"meta_whitelist = {\n \"cycle_network_colour\",\n " // cycle network colour is sneaked in here for legacy reasons "meta_whitelist = {\n"
+ string.Join("\n , ", _profile.Metadata.Select(s => "\"" + s + "\"")) + string.Join("\n , ", _profile.Metadata.Select(s => "\"" + s + "\""))
+ " }", + " }",
"profile_whitelist = {\n " + string.Join("\n , ", keys) + "\n }", "profile_whitelist = {\n " + string.Join("\n , ", keys) + "\n }",

View file

@ -13,5 +13,10 @@ function legacy_relation_preprocessor(attributes, result)
-- for the americans! -- for the americans!
result.attributes_to_keep.cycle_network_colour = attributes.color result.attributes_to_keep.cycle_network_colour = attributes.color
end end
if (attributes.ref ~= nil) then
-- for the americans!
result.attributes_to_keep.cycle_network_ref = attributes.ref
end
end end
end end

View file

@ -11,6 +11,7 @@
"tunnel", "tunnel",
"colour", "colour",
"cycle_network_colour", "cycle_network_colour",
"cycle_network_ref",
"ref", "ref",
"status", "status",
"network" "network"