Making the turn function more flexible (#4789)
* set and store highway and access classification for the turn function * expose highway turn classification and access turn classification and speed to the lua profile turn function * expose whether connection road at turn is incoming or outgoing * add lua tests for exposed information to turn function * update docs about attributes in process_turn * add turn_classification info to docs * adding warning if uturn and intersection dont match * handle u turns that do not turn into intersection[0] * split OSM link generation in an accessible coordinate function
This commit is contained in:
committed by
GitHub
parent
13bb997525
commit
61e06fcaba
@@ -221,6 +221,23 @@ function WayHandlers.hov(profile,way,result,data)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- set highway and access classification by user preference
|
||||
function WayHandlers.way_classification_for_turn(profile,way,result,data)
|
||||
local highway = way:get_value_by_key("highway")
|
||||
local access = way:get_value_by_key("access")
|
||||
|
||||
if highway and profile.highway_turn_classification[highway] then
|
||||
assert(profile.highway_turn_classification[highway] < 16, "highway_turn_classification must be smaller than 16")
|
||||
result.highway_turn_classification = profile.highway_turn_classification[highway]
|
||||
end
|
||||
if access and profile.access_turn_classification[access] then
|
||||
assert(profile.access_turn_classification[access] < 16, "access_turn_classification must be smaller than 16")
|
||||
result.access_turn_classification = profile.access_turn_classification[access]
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- check accessibility by traversing our access tag hierarchy
|
||||
function WayHandlers.access(profile,way,result,data)
|
||||
data.forward_access, data.backward_access =
|
||||
|
||||
Reference in New Issue
Block a user