Repository navigation
Description
Status: done
Size: M
Part of #3286 (round 2, after the owner's browser check).
Systems: routing
TL;DR
Goal: A road that is open only for traffic to a destination ("Anlieger frei" in Germany, "Zubringerdienst gestattet" in Switzerland) is an open road for the planner: the route search does not avoid it, and the rider gets no note for it.
Problem: OpenStreetMap tags such a road with the access value destination. The route build treats that value as doubtful access. So a route over such a road shows the note "Only for destination", and the route search counts the road three times as long. These roads are often the quiet roads that a rider wants.
Decision: The owner decided that a rider can ignore this restriction. The route build records no closure for the access value destination, for cycling, walking and pushing. Everything else about the value stays as it is: which modes it opens, and how a list of values resolves. The change takes effect with the next build of the routing data; this issue starts no build.
Rejected:
- To make
destinationthe same asyes(Access::Open):grantedwould then open a motor road forbicycle=destination, and a list such asprivate;destinationwould lose itsprivateclosure. - To hide the note in the web planner only: the route search would still avoid the road, and the iOS app would still show the note.
- No closure for cycling only: the owner spoke about bicycles, but a rule for each mode needs more code, and a walker passes such a road too. The owner can ask for it.
Contracts:specs/route-api.md(the table of the closure kinds)
Size: M (a compatible contract change)
Words
- Access value: the value of an OpenStreetMap access tag (
access,vehicle,bicycle,foot) that applies to one mode on one road. - Closure: why a rider may have no access to a road that the route uses (
Closureinplanner/router/src/closures.rs). Its kindlimitedmeans an access value for another group. - Layer revision: the data build reuses the old output of a layer until the
revisionof the layer goes up (host/obc-data/README.md, section "Pitfalls").
Facts
classifyinplanner/router-build/src/source.rsmapsdestination,customers,delivery,residentsand other values toAccess::Uncertain(Kind::Limited). Of a list such asagricultural;forestryit takes the most open value.classifyhas four callers:granted,accessandclosuresinsource.rs, and the access overlay inplanner/router-build/src/overlays/access.rs.Kind::avoidedinplanner/router/src/closures.rsis true forLimited.way_basesinplanner/router-build/src/cost.rsmultiplies the cost of a road with a doubtful access value byUNCERTAIN_ACCESS(3.0), and a node costsUNCERTAIN_NODE(300 m).inheritedinsource.rsresolves the value of one mode from the tags: for the bicycleaccess,vehicle,bicycle; for walkingaccess,foot. A road withmotor_vehicle=destinationdoes not restrict the bicycle today.accessinsource.rssets the bits of a mode when the value opens it, andgranteddecides if an explicit tag opens a mode on a road that is closed by default, such as a motor road. Both readclassify.- Tests that fix the old behavior:
only_no_closes_and_every_other_restriction_becomes_a_closureinsource.rs(it expectsclosure(Kind::Limited, "destination")), and the test ofoverlays/access.rsthat expects the overlay class "limited" foraccess=destination.cost.rshas no test with this value. specs/route-api.mdlistsdestinationas the first value of the kindlimited.PLANNER_ROUTINGinhost/obc-data-steps/src/planner.rsholds the routing package, its grid and the route network overlays.- The web planner words a
limitedclosure as "Only for " and the value (phrases.limitedinbuilder/web/src/lib/planner/route-closures.ts).
Plan
source.rs:closuresrecords no closure when the access value that applies to a mode isdestination.classify,granted,accessand the handling of a list do not change, so the value opens the same modes as today. Choose the smallest form for this: for example a check of the value inclosures, or a kind thatclosuresdoes not record. One comment gives the reason: the owner decided that a rider and a walker pass a road that is signed for traffic to a destination. The other values of the kindlimiteddo not change. A node, such as a gate, follows the same rule and is no doubt any more.planner/router-build/src/overlays/access.rs:access=destinationgives no overlay class.- Tests: in
source.rs, the case ofonly_no_closes_and_every_other_restriction_becomes_a_closurethat expectsclosure(Kind::Limited, "destination")now expects no closure for that value; a test of the kindlimitedtakescustomers. Add cases:access=destinationonhighway=footwayopens the same modes as before this change;bicycle=destinationon a motor road stays closed;private;destinationkeeps what it gives today. Inoverlays/access.rs, the test that expects the class "limited" foraccess=destinationexpects none.doubtsincost.rsneeds no new test: without a closure there is no doubt. planner/router/src/closures.rs: the comment ofKind::Limitednamesdestinationas its first example; take it out.specs/route-api.md: deletedestinationfrom the values of the kindlimitedin the table of the closure kinds, and say in the paragraph under "Edges" that starts "The router blocks a mode only for" that a way or a node with the valuedestinationcarries no closure.specs/vectors/has no vector with this value.host/obc-data-steps/src/planner.rs: raise therevisionofPLANNER_ROUTINGby one from its value onplanner-uxat build time. The routing package and the overlays ofplanner/overlaysare built under this layer; confirm it and say so in the pull request.- Search for readers of the value:
grep -rn "destination"inbuilder/web/src/lib/planner,companion-iosanddocs/contentfor a text, a test or a doc that names "Only for destination", and update what is stale. The wording function of the web planner stays.
Done when
obc test -p planner-router-buildandobc exec cargo clippy -p planner-router-build --all-targets --no-deps -- -D warnings; the same for each other crate that changes.- The pull request says that the change needs the next build of the routing data, and that the route search then no longer avoids these roads.
Activity