Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 3 of 3

Get distances/driving times between waypoints

This is a discussion on Get distances/driving times between waypoints within the MapPoint Desktop 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 ...

  1. #1
    Jonathan Shields is offline Junior Member White Belt
    Join Date
    Jan 2006
    Posts
    6

    Get distances/driving times between waypoints

    Hi,

    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.

  2. #2
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    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));

  3. #3
    Jonathan Shields is offline Junior Member White Belt
    Join Date
    Jan 2006
    Posts
    6
    Wilfried,

    thanks a lot for your reply. I will try this out.

    Jonathan

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Huge Number of Drive Times
    By lbequis in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 08-27-2005, 09:31 AM
  2. Schedule Stop Times
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 13
    Last Post: 06-06-2005, 04:41 AM
  3. Import stop times?
    By PBrantley in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 03-22-2005, 10:57 AM
  4. Driving Day - How to turn off?
    By Clive2004 in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 01-06-2004, 06:42 AM
  5. Planning a route after arrival times
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 02-24-2003, 08:11 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27