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

Restricting border crossings? #5238

Closed
tim-myth opened this issue Oct 18, 2018 · 6 comments
Closed

Restricting border crossings? #5238

tim-myth opened this issue Oct 18, 2018 · 6 comments
Labels

Comments

@tim-myth
Copy link

How would one go about restricting national border crossings? Is such s thing even possible?
For example:
http://map.project-osrm.org/?z=6&center=41.975827%2C-75.212402&loc=46.879232%2C-96.929228&loc=44.310583%2C-69.779663&hl=en&alt=0

This route originates in the U.S., crosses into Canada, and terminates in the U.S.

@daniel-j-h
Copy link
Member

You can modify the profile to put high weights onto these crossings. Check out how we currently penalize e.g. gated communities (destination tags).

@Bahmer
Copy link

Bahmer commented Nov 27, 2018

I'm trying to restrict border crossing as well but have not been able to get it to work. I've tried only loading the Canada pbf file but then I get a NoRoute error (Impossible route between points) when routing from southern Ontario (I think it is trying to route through the U.S. but can't since the data is not there). I had it working at one point using Canada only and result.barrier = true where barrier == "border_control" but with the latest version of OSRM and the latest pbf files, setting the barrier tag no longer seems to work. I have also tried the same, blacklisting border_control, with the North America pbf file but it still routes through the U.S. I looked at the destination tag references in the lua files but have not been able to figure out how to apply that to an international border. Any help with this would be greatly appreciated.

@aroksaf
Copy link

aroksaf commented May 3, 2023

Has anyone figured out how to solve this problem? I am running into the same issue and not sure how to solve for it.

@nilsnolde
Copy link
Contributor

Not sure how @daniel-j-h envisioned that to work, AFAIK such roads aren’t really tagged accordingly/consistently. And OSRM doesn’t process OSM admins. So I think it’s just not possible currently right?

FWIW, Valhalla does that. It builds its own admin database form the OSM data, partly because for this use case.

@danpat
Copy link
Member

danpat commented May 3, 2023

OSRM has the "location dependent data" feature - a geojson file with properties that are accessible during processing, but it'd need a bit of work to make it work for border crossings. It's currently only used for left/right driving side.

  1. You'd need a GeoJSON file for countries - those are available, but we don't have one handy. As @nilsnolde pointed out, Valhalla effectively builds something like this from the raw OSM data.
  2. The turn function where you'd need to apply the penalty I don't believe is passed the location dependent data currently - that would need to get fixed.

Copy link

github-actions bot commented Jul 8, 2024

This issue seems to be stale. It will be closed in 30 days if no further activity occurs.

@github-actions github-actions bot added the Stale label Jul 8, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants