Closed jerryfaust closed 6 years ago
The search distance only has an effect on the first and last point not on routeplanning. That means something else is wrong. A couple of things you can check:
If you want you can always post code to reproduce this with data and profile, I can then try and figure out what's going on.
Ok. I found the solution.
After resolving an endpoint, I should not have used my endpoint coordinate for the Calculation. Instead, I needed to call RouterPointExtensions.LocationOnNetwork to get the position on the network edge that was 'resolved' based on my input point. This is the value to pass in to the Calculate method.
If you don't mind my saying, I think it would be good to include this in some of the samples. For example, the sample and image here: http://docs.itinero.tech/docs/itinero/basic-concepts/routerpoint.html provide an excellent visualization of how an input 'location' is resolved to a network edge. It would be beneficial to then show how to get the coordinate of that RouterPoint, by calling LocationOnNetwork, since that is the coordinate that should be passed in to the Calculate method.
Respectfully. Thank you.
The idea is that you first 'resolve' and then pass along that result to the router. You can pass the routerpoints directly to the router class. Appreciate the feedback will leave a small TODO here:
This example does what I mean, pass the routerpoints to the router instead of the locationonnetwork:
http://docs.itinero.tech/docs/itinero/basic-concepts/index.html#example
Got it. I'm sorry, I missed that. Thank you.
Hello.
I am in a situation in which I need to allow for more than 50 meters from a start/end point to the nearest street. I can specify a tolerance (searchDistanceInMeters) when 'Resolving' the endpoints, but I cannot specify a tolerance when Calculating, and as a result, my Calculate fails even though my endpoints were accepted.
Am I overlooking something?
Thank you. Jerry