itinero / routing

The routing core of itinero.
Apache License 2.0
222 stars 71 forks source link

Route.ProjectOn timeFromStartInSeconds is always 0 #157

Closed msioen closed 6 years ago

msioen commented 6 years ago

RouteExtension method ProjectOn has an out parameter timeFromStartInSeconds which will always be 0: https://github.com/itinero/routing/blob/develop/src/Itinero/RouteExtensions.cs#L399

Is it correct to use the DistanceAndTimeAt extension method instead at this point with the returned segment from the ProjectOn call to get the time?

As far as I can see there will be slight difference in returned distance as the DistanceAndTimeAt won't take in account that you might be in between shapes, I'm not sure however if it could make a big enough difference for the time.

xivk commented 6 years ago

It depends, segments can be pretty long but when navigating in a city context it should be fine for now.

So yes, in most cases it will be fine, but there will be cases where this is not enough. I'll try and fix this asap, latest tomorrow. It should use the time specified in the segment to calculate the exact time depending on the distance from the start of the segment.