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

Stop osrm "connecting" to the network via certain types of roads #116

Closed
tra6sdc opened this issue Oct 23, 2022 · 6 comments
Closed

Stop osrm "connecting" to the network via certain types of roads #116

tra6sdc opened this issue Oct 23, 2022 · 6 comments

Comments

@tra6sdc
Copy link

tra6sdc commented Oct 23, 2022

Hello, I have this origin/destination route and the distance isn't reasonable. What is happening is that the origin is connecting to a Motorway, between junctions, then travelling down to the Motorway exit, leaving the motorway and travelling back to the destination. This distance is 11.1km whilst the distance when the origin connects to a local road should be 300m (or 500m if we count the distance to connect to the road). Is there a way to stop the connecting to certain types of road?

http://map.project-osrm.org/?z=13&center=53.623925%2C-1.570873&loc=53.642224%2C-1.533966&loc=53.641620%2C-1.528497&hl=en&alt=0&srv=0

I have setup my own local server using these instructions: https://github.com/Project-OSRM/osrm-backend/wiki/Running-OSRM

I changed these two parameters in the car.lua files from the default (my .lua files are old, the date stamp is July, 2018):

properties.continue_straight_at_waypoint   = false
properties.left_hand_driving               = true
@rCarto
Copy link
Member

rCarto commented Oct 24, 2022

In osrm you can use the exclude arg.
osrmRoute(..., exclude = "motorway")

@tra6sdc
Copy link
Author

tra6sdc commented Oct 24, 2022

Thanks. I tried this

 try(osrmRoute(src = o, dst = d, overview = FALSE, exclude = "motorway"))

and I get the error message:

Error : OSRM API request failed [400]
InvalidValue
Exclude flag combination is not supported.

I am happy for the route to include a motorway just NOT match to a motorway at the start of the route. BUT if to enable a match to a non-motorway road at the start I needed to exclude motorways entirely, that's fine. But using what you have suggested no routes are found. Thanks for looking into this issue. Should I be raising it on the Project-OSRM github instead?

@rCarto
Copy link
Member

rCarto commented Oct 31, 2022

This problem could be solved with the OSRM nearest service, not yet implemented in the R package.
The exclude parameter is not implemented in the OSRM demo server but it should work with a local recent version of OSRM. Maybe your version is a bit outdated?

@tra6sdc
Copy link
Author

tra6sdc commented Oct 31, 2022

Thanks. The R package is 4.0.0 which is up to date.

I am happy to update the Windows software. The versions I am using are old, from before July 2018. Can you remind me where to obtain more recent versions? I will then try the exclude parameter. Thanks.

28/07/2018  11:07         (155,136) osrm-components.exe
28/07/2018  11:07         (947,200) osrm-contract.exe
28/07/2018  11:07         (873,472) osrm-customize.exe
28/07/2018  11:07         (506,880) osrm-datastore.exe
28/07/2018  11:07       (3,159,040) osrm-extract.exe
28/07/2018  11:07         (685,056) osrm-partition.exe
28/07/2018  11:07         2,317,824 osrm-routed.exe

@rCarto
Copy link
Member

rCarto commented Oct 31, 2022

I don't know how to install OSRM on windows. The best place get instructions is probably the OSRM server GitHub repo.

@tra6sdc
Copy link
Author

tra6sdc commented Oct 31, 2022

Thanks. I've looked at that page previously and been unable to comprehend it. I'll just stick with having this issue.

@tra6sdc tra6sdc closed this as completed Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants