Community of VE/MapPoint Users and Developers
This is a discussion on Get distances/driving times between waypoints within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi, I am currently integrating MapPoint 2004 into a VB6 application. The application uses MapPoint to calculate the driving distance ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Get distances/driving times between waypoints I am currently integrating MapPoint 2004 into a VB6 application. The application uses MapPoint to calculate the driving distance and time between calls at different addresses for an employee. It currently does by this creating a map, adding two waypoints for each journey between calls, calculating the route and passing back the driving distance and time to the main application, then closing the map. This is then repeated for each journey between addresses in the employees workload for that day. When this process is performed for several hundred employees it gets pretty slow, so I want to improve the performance. I have done this to some extent by creating a map only once, then calculating each successive journey between zip codes on the same map, clearing the route every time. This has produced an improvement. What I would like to do now is to add ALL the postcodes representing an employees calls that day to the map as waypoints, then calculate the route for the whole day instead of using pairs of calls and calculating the route between these. I have tried this but there is no way of accessing the driving time and distance between each waypoint in the route without MapPoint recalculating the route between the two waypoints, and I need the individual driving time/distance between each pair of Waypoints. This information must be somewhere within MapPoint as MapPoint must internally total this information up in order to get the overall time/distance for the route, but I can see no object/property/method that allows me to get at it. Does anyone have any ideas? I hope I have clearly explained the problem Basically instead of Add Postcode 1 waypoint Add postcode 2 waypoint calculate route to get time/distance Add postcode 2 waypoint Add postcode 3 waypoint calculate route to get time/distance I want to Add Postcode 1 waypoint Add postcode 2 waypoint Add postcode 3 waypoint calculate whole route 1>3 and find the postcode 1>postcode 2 time/distance and the postcode 2>postcode 3 time/distance without performing another route calculation Thanks you in advance for your help. |
| |||
|
Hi, Yes it is possible. This is working example in C#. Each waypoint has his local StartTime and Distance calculated against next waypoint. Code: Directions dir = route.Directions;
foreach (MapPoint.Direction d in dir) {
Console.WriteLine("Start time: " + Convert.ToString(d.StartTime));
Console.WriteLine("Distance: " + Convert.ToString(d.Distance));
Console.WriteLine("Instruction: " + d.Instruction);
}
Console.WriteLine("Total driving time: " + Convert.ToString(route.DrivingTime));
Console.WriteLine("Total distance: " + Convert.ToString(route.Distance));
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
![]() |
| Tags |
| distances or driving, times, waypoints |
| ||||
| Posted By | For | Type | Date | |
| Driving Times Distances in Spain | This thread | Refback | 01-15-2008 12:53 AM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Huge Number of Drive Times | lbequis | MapPoint 2006/2009 Discussion | 3 | 08-27-2005 09:31 AM |
| Schedule Stop Times | Anonymous | MapPoint 2006/2009 Discussion | 13 | 06-06-2005 04:41 AM |
| Import stop times? | PBrantley | MapPoint 2006/2009 Discussion | 0 | 03-22-2005 10:57 AM |
| Driving Day - How to turn off? | Clive2004 | MapPoint 2006/2009 Discussion | 1 | 01-06-2004 06:42 AM |
| Planning a route after arrival times | Anonymous | MapPoint 2006/2009 Discussion | 0 | 02-24-2003 08:11 AM |