Skip to content

Routing: a road for traffic to a destination is an open road #3369

Closed

Description

@timohueser

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 destination the same as yes (Access::Open): granted would then open a motor road for bicycle=destination, and a list such as private;destination would lose its private closure.
  • 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 (Closure in planner/router/src/closures.rs). Its kind limited means an access value for another group.
  • Layer revision: the data build reuses the old output of a layer until the revision of the layer goes up (host/obc-data/README.md, section "Pitfalls").

Facts

  • classify in planner/router-build/src/source.rs maps destination, customers, delivery, residents and other values to Access::Uncertain(Kind::Limited). Of a list such as agricultural;forestry it takes the most open value.
  • classify has four callers: granted, access and closures in source.rs, and the access overlay in planner/router-build/src/overlays/access.rs.
  • Kind::avoided in planner/router/src/closures.rs is true for Limited. way_bases in planner/router-build/src/cost.rs multiplies the cost of a road with a doubtful access value by UNCERTAIN_ACCESS (3.0), and a node costs UNCERTAIN_NODE (300 m).
  • inherited in source.rs resolves the value of one mode from the tags: for the bicycle access, vehicle, bicycle; for walking access, foot. A road with motor_vehicle=destination does not restrict the bicycle today.
  • access in source.rs sets the bits of a mode when the value opens it, and granted decides if an explicit tag opens a mode on a road that is closed by default, such as a motor road. Both read classify.
  • Tests that fix the old behavior: only_no_closes_and_every_other_restriction_becomes_a_closure in source.rs (it expects closure(Kind::Limited, "destination")), and the test of overlays/access.rs that expects the overlay class "limited" for access=destination. cost.rs has no test with this value.
  • specs/route-api.md lists destination as the first value of the kind limited.
  • PLANNER_ROUTING in host/obc-data-steps/src/planner.rs holds the routing package, its grid and the route network overlays.
  • The web planner words a limited closure as "Only for " and the value (phrases.limited in builder/web/src/lib/planner/route-closures.ts).

Plan

  1. source.rs: closures records no closure when the access value that applies to a mode is destination. classify, granted, access and 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 in closures, or a kind that closures does 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 kind limited do not change. A node, such as a gate, follows the same rule and is no doubt any more.
  2. planner/router-build/src/overlays/access.rs: access=destination gives no overlay class.
  3. Tests: in source.rs, the case of only_no_closes_and_every_other_restriction_becomes_a_closure that expects closure(Kind::Limited, "destination") now expects no closure for that value; a test of the kind limited takes customers. Add cases: access=destination on highway=footway opens the same modes as before this change; bicycle=destination on a motor road stays closed; private;destination keeps what it gives today. In overlays/access.rs, the test that expects the class "limited" for access=destination expects none. doubts in cost.rs needs no new test: without a closure there is no doubt.
  4. planner/router/src/closures.rs: the comment of Kind::Limited names destination as its first example; take it out.
  5. specs/route-api.md: delete destination from the values of the kind limited in 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 value destination carries no closure. specs/vectors/ has no vector with this value.
  6. host/obc-data-steps/src/planner.rs: raise the revision of PLANNER_ROUTING by one from its value on planner-ux at build time. The routing package and the overlays of planner/overlays are built under this layer; confirm it and say so in the pull request.
  7. Search for readers of the value: grep -rn "destination" in builder/web/src/lib/planner, companion-ios and docs/content for 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-build and obc 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions