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

Exact points routing #1473

Closed
Guipa opened this issue May 13, 2015 · 8 comments
Closed

Exact points routing #1473

Guipa opened this issue May 13, 2015 · 8 comments

Comments

@Guipa
Copy link

Guipa commented May 13, 2015

Hi,

Is there a way to do a routing (car profile) from exact coordinates to exact coordinates (with no phantom nodes) ? In other words, can osrm calculate a route strictly from point A to Point B. If coordinates of point A and point B are not those of existing nodes then we would like OSRM not to give us a route.

Is there a way to do that ? (we already try with the z parameter but no effect. So I guess it has to be modified in the code).

Thanks for any help

@emiltin
Copy link
Contributor

emiltin commented May 14, 2015

You could use the locate() API (see https://github.com/Project-OSRM/osrm-backend/wiki/Server-api#service-locate) to first check if your coordinates matches osm nodes. If they do use the normal viaroute() API.
You could also just use the normal viaroute() API and then check if the start and end points match your coordinates.

@Guipa
Copy link
Author

Guipa commented May 14, 2015

Hi Emil,

In fact, in my osm file, I have a node with these coordinates : 48.5781129,-3.8326438. This node is the first point of a way tagged highway=motorway_link
When I do a viaroute, with these coordinates as a starting point, I have a route with not so much sense.

When I do a locate on this coordinates, I obtain 48.578114, -3.832643. These coordinates do not correspond to any node contained in my osm. It looks like a phantom node created by OSRM.

Is there a way to avoid OSRM to create such phantom nodes ?

We would like OSRM just to follow the ways with the node of the osm file …

Thanks for your help

Le 14 mai 2015 à 10:10, Emil Tin notifications@github.com a écrit :

You could use the locate() API (see https://github.com/Project-OSRM/osrm-backend/wiki/Server-api#service-locate https://github.com/Project-OSRM/osrm-backend/wiki/Server-api#service-locate) to first check if your coordinates matches osm nodes. If they do use the normal viaroute() API.
You could also just use the normal viaroute() API and then check if the start and end points match your coordinates.


Reply to this email directly or view it on GitHub #1473 (comment).

@woodbri
Copy link

woodbri commented May 14, 2015

On 5/14/2015 4:10 AM, Emil Tin wrote:

You could use the locate() API (see
https://github.com/Project-OSRM/osrm-backend/wiki/Server-api#service-locate)
to first check if your coordinates matches osm nodes. If they do use the
normal viaroute() API.
You could also just use the normal viaroute() API and then check if the
start and end points match your coordinates.

I believe that the user points are projected onto an edge to create a
virtual node and then the routing is done from the virtual nodes.

The locate API will return the location of the virtual node what may be
between two physical nodes. Matching the start and end points with the
original nodes will only tell you if the original nodes were positioned
exactly over an edge such that the original node is equal to the virtual
node.

Unless I'm totally off base on how this works in OSRM, I do not think
there is any way to check this or to determine the closest actual node
without adding a new API function.

-Steve

@Guipa
Copy link
Author

Guipa commented May 14, 2015

Hi Steve,

Thanks for your response. It ’s too bad we can’t avoid creation of virtual nodes … routing could be strictly exact if it was possible.
Any idea how far (distance) should a starting node be from other nodes to avoid virtual node ?

Thanks again

Le 14 mai 2015 à 16:00, Stephen Woodbridge notifications@github.com a écrit :

On 5/14/2015 4:10 AM, Emil Tin wrote:

You could use the locate() API (see
https://github.com/Project-OSRM/osrm-backend/wiki/Server-api#service-locate)
to first check if your coordinates matches osm nodes. If they do use the
normal viaroute() API.
You could also just use the normal viaroute() API and then check if the
start and end points match your coordinates.

I believe that the user points are projected onto an edge to create a
virtual node and then the routing is done from the virtual nodes.

The locate API will return the location of the virtual node what may be
between two physical nodes. Matching the start and end points with the
original nodes will only tell you if the original nodes were positioned
exactly over an edge such that the original node is equal to the virtual
node.

Unless I'm totally off base on how this works in OSRM, I do not think
there is any way to check this or to determine the closest actual node
without adding a new API function.

-Steve

Reply to this email directly or view it on GitHub #1473 (comment).

@emiltin
Copy link
Contributor

emiltin commented May 14, 2015

I though locate returns the nearest osm node (it seem to say so in the wiki) but I could be wrong.

@Guipa
Copy link
Author

Guipa commented May 14, 2015

Yes, you are right.
I think, the way to avoid virtual nodes creation (or limiting to a max distance) maybe could be set in :

boost::program_options::value(&max_locations_distance_table)->default_value(100),
"Max. locations supported in distance table query")(
"max-matching-size,m »,

What do you think ?

Le 14 mai 2015 à 18:02, Emil Tin notifications@github.com a écrit :

I though locate returns the nearest osm node (it seem to say so in the wiki) but I could be wrong.


Reply to this email directly or view it on GitHub #1473 (comment).

@woodbri
Copy link

woodbri commented May 14, 2015

ok, good to know. I was always a little confused about locate and nearest and this clears that up. Thanks.

@daniel-j-h
Copy link
Member

The locate service is gone by now as it would have required great effort in the static rtree code.
The nearest service is still there, but returns the nearest routable segment.

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

4 participants