Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong car routing through motor_vehicle=delivery #2150

Closed
marcows opened this issue Mar 25, 2016 · 3 comments
Closed

Wrong car routing through motor_vehicle=delivery #2150

marcows opened this issue Mar 25, 2016 · 3 comments

Comments

@marcows
Copy link

marcows commented Mar 25, 2016

See http://map.project-osrm.org/?z=17&center=49.318213%2C8.572083&loc=49.316863%2C8.575462&loc=49.316517%2C8.574700&hl=en&alt=0
The two streets connecting each service area with the street over the motorway are tagged with motor_vehicle=delivery, so they shouldn't be used.

Further info:
https://lists.openstreetmap.org/pipermail/talk/2016-February/075526.html

See also @Fujnky's comment on issue #256 illustrating a similar problem.

@daniel-j-h
Copy link
Member

Thank you for reporting this. I looked into it and this is what I found:

If you take a look at the car profile you can see access=motor_vehicle in the whitelist, so we're currently routing over it unconditionally. motor_vehicle=delivery is something different. Here's its taginfo.

If you take a look at the access_tag_restricted list you can find access=delivery in there. But access_tag_restricted is not used at the moment and will only be used in the future to augment the route response e.g. for guidance.

@marcows
Copy link
Author

marcows commented Mar 30, 2016

access=motor_vehicle is something different, we only talk about motor_vehicle as a key, not as a value (which catches wrong mapping like access=motor_vehicle I guess - or are these preprocessed tags, not directly related to OSM tags?).

I just tried and learned OSRM also routes through roads with motor_vehicle=destination. Is this on purpose because detection of whether the routing target is inside a destination area is not implemented yet?

I've read the car profile lua code (which I only skimmed through before writing this issue) and conclude that access_tag_whitelist only has any influence for highway values not included in speed_profile (highway=track or unknown highway values) - and then only on the speed, not on access. For prohibiting access, access_tag_blacklist has to contain the concerned access value.

But access_tag_restricted is not used at the moment and will only be used in the future to augment the route response e.g. for guidance.

I don't understand what "to augment the route response e.g. for guidance" means.

So in my opinion the following patch (untested) might fix this issue as long as restricted access is not implemented (at least from what I currently think restricted means in case of OSRM):

diff --git a/profiles/car.lua b/profiles/car.lua
index f6bfd23..8e0fd74 100644
--- a/profiles/car.lua
+++ b/profiles/car.lua
@@ -5,7 +5,7 @@ local find_access_tag = require("lib/access").find_access_tag
 -- Begin of globals
 barrier_whitelist = { ["cattle_grid"] = true, ["border_control"] = true, ["checkpoint"] = true, ["toll_booth"] = true, ["sally_port"] = true, ["gate"] = true, ["lift_gate"] = true, ["no"] = true, ["entrance"] = true }
 access_tag_whitelist = { ["yes"] = true, ["motorcar"] = true, ["motor_vehicle"] = true, ["vehicle"] = true, ["permissive"] = true, ["designated"] = true, ["destination"] = true }
-access_tag_blacklist = { ["no"] = true, ["private"] = true, ["agricultural"] = true, ["forestry"] = true, ["emergency"] = true, ["psv"] = true }
+access_tag_blacklist = { ["no"] = true, ["private"] = true, ["agricultural"] = true, ["forestry"] = true, ["emergency"] = true, ["psv"] = true, ["delivery"] = true }
 access_tag_restricted = { ["destination"] = true, ["delivery"] = true }
 access_tags = { "motorcar", "motor_vehicle", "vehicle" }
 access_tags_hierachy = { "motorcar", "motor_vehicle", "vehicle", "access" }

@daniel-j-h
Copy link
Member

But access_tag_restricted is not used at the moment and will only be used in the future to augment the route response e.g. for guidance.

I don't understand what "to augment the route response e.g. for guidance" means.

In case we have to route you over those, we want to notify you about it in the user interface / the instructions. The access_tag_restricted list itself does not prevent routing over its values.

I had to take a deeper look at the profiles myself, so here's a guided tour through the car profile:

The find_access_tag function takes a node or a way and checks if there are values for the keys: "motorcar", "motor_vehicle", "vehicle", "access" as listed in the access_tags_ hierachy list.

For nodes we check if the value is in the access_tag_blacklist and if so mark the node as a barrier.

For ways we check if the value is in the access_tag_blacklist and if so discard that way.

Your proposed change therefore effects the following nodes and ways:

http://taginfo.openstreetmap.org/tags/motorcar=delivery
http://taginfo.openstreetmap.org/tags/motor_vehicle=delivery
http://taginfo.openstreetmap.org/tags/vehicle=delivery
http://taginfo.openstreetmap.org/tags/access=delivery

Which looks fine to me for preventing routing over delivery-only nodes or ways. I will create a pull request with your changes and let @TheMarex take a final look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants