PDA

View Full Version : Trying to get distance considering driver's current heading

BobFromBoston
11-09-2005, 05:39 PM
Greetings,

I have included a simplified version of the code I use to calculate the distance from the driver's last known location to his next stop.

MapPoint.Location locA =
mpMap.GetLocation( pointA.Latitude, pointA.Longitude, 100 );

MapPoint.Location locB =
mpMap.GetLocation( pointB.Latitude, pointB.Longitude, 100 );

mpRoute.Calculate();

But I need a way to introduce the driver's last known HEADING, otherwise using simply his last known LOCATION will produce an unrealistic route. If he's driving east, then there's no point in using MapPoint's best estimate,
which may require that he head west. I have no ability to re-direct the driver; I'm simply using MapPoint to help create an educated guess when the driver will arrive.

Does anyone know how to use his heading to get MapPoint to make a more realistic route between the two points?

Thanks.

Wilfried
11-10-2005, 02:28 PM
Hi,

Looks tricky to do. One way could be to set a waypoint on the same road in the direction where the vehicle runs on a point where it could be at the current speed and then calculate.

However next problem is to get that point snap to a road, easy done, but you dont know ifit is the road, and heading.. maybe the car is just in a curve?

I should say it is word to try but I dont think you can have good results. However maybe the one idea brings out other ideas :)