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 5 of 5

Add Waypoints Starts to get Really Slow

This is a discussion on Add Waypoints Starts to get Really Slow within the Development forums, part of the MapPoint Desktop Discussion category; After 30 or so stops, it seems adding waypoints starts to get really slow... Waypoints collection My code is very ...

  1. #1
    Eric Frost's Avatar
    Eric Frost is offline Administrator Black Belt
    Join Date
    Jul 1992
    Posts
    5,094
    Blog Entries
    4

    Add Waypoints Starts to get Really Slow

    After 30 or so stops, it seems adding waypoints starts to get really slow...

    Waypoints collection

    My code is very simple, it's just looping over a recordset and adding the recordset location.

    For the Waypoint Anchor, I tried adding the recordset location, the recordset's pushpin object, and the pushpin's location, no matter which it didn't seem to make a difference.

    When it gets up to around 60+ waypoints, it can take 2 seconds to add each waypoint.

    I have about 40 routes with around 80 stops each, so you can see this could easily take hours.

    Is there a way to maybe add all the waypoints in a batch? With the regular interface, you can right-click on a Pushpin set in the Legend and select Add As Stops in one fell swoop and this is very fast. I don't see any equivalent in the Windows API. Maybe I have to get out WinSpy and figure out what windows message to send? (I'm not confident I could figure this out myself.)

    Anyway, any advice or pointers much appreciated!

    Eric
    ~ Order MapPoint MapPoint 2013 Here and Get Free Access to the MapForums Downloads ~
    ~~
    ~ Upgrade to Get Access to the MapForums Downloads ~

  2. #2
    Mattys Consulting's Avatar
    Mattys Consulting is offline Senior Member Black Belt
    Join Date
    Dec 2002
    Posts
    1,040

    Re: Add Waypoints Starts to get Really Slow

    Hi Eric,

    I usually start a new map after a determined amount of pushpins or routes.
    Clearing all instantiated class variables is important to that process.
    Keeping the map invisible until calculation is finished helps a great deal also.

    I'll look into the batch adding part - that is interesting.
    Michael R Mattys
    Business Process Developers
    www.mattysconsulting.com

  3. #3
    Eric Frost's Avatar
    Eric Frost is offline Administrator Black Belt
    Join Date
    Jul 1992
    Posts
    5,094
    Blog Entries
    4

    Re: Add Waypoints Starts to get Really Slow

    Quote Originally Posted by Mattys Consulting View Post
    I'll look into the batch adding part - that is interesting.
    If you figured this out, that would be really awesome!

    Eric
    ~ Order MapPoint MapPoint 2013 Here and Get Free Access to the MapForums Downloads ~
    ~~
    ~ Upgrade to Get Access to the MapForums Downloads ~

  4. #4
    Jonathon Smith is offline Junior Member White Belt
    Join Date
    Apr 2012
    Posts
    1

    Re: Add Waypoints Starts to get Really Slow

    I expect the problem is to do with how poor MapPoint's garbage collection is. Everything I do with MapPoint via automation is wrapped into a class that saves the map and reopens after x number of actions which forces MapPoint to release memory that it otherwise would just hold onto, the problem seems especially bad when importing from data sets because it seems MapPoint pulls all the data it is importing into memory and just keeps it there until you close the map.

  5. #5
    Eric Frost's Avatar
    Eric Frost is offline Administrator Black Belt
    Join Date
    Jul 1992
    Posts
    5,094
    Blog Entries
    4

    Re: Add Waypoints Starts to get Really Slow

    For my specific project, I still loop over the recordset and add waypoints individually, but I was able to speed it up a lot by just working with a single route at a time.

    What I done initially, was import ALL the routes (could be 30 or 50) and then drill down and work with individual routes, but still having all the routes as separate datasets in the legend.

    I think because my map had so much stuff on it (literally thousands of pushpins and dozens of datasets) it was getting seriously bogged down.

    By simply importing one route at a time, and then start with a new map for the next route, the processing time for this project was bearable.

    Nonetheless, it would still be a LOT faster if I didn't have to loop over the recordset and add waypoints individually, this is by far the biggest bottleneck with this project. In comparison, the Optimization and Calculation of the route does not take much time.
    ~ Order MapPoint MapPoint 2013 Here and Get Free Access to the MapForums Downloads ~
    ~~
    ~ Upgrade to Get Access to the MapForums Downloads ~

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Bing Maps & SharePoint 2010 The Journey Starts
    By Johannes Kebeck's Blog in forum Bing Maps Blogs & Tweets
    Replies: 0
    Last Post: 05-14-2010, 01:24 PM
  2. Replies: 0
    Last Post: 03-09-2010, 05:12 AM
  3. Replies: 0
    Last Post: 11-17-2009, 12:00 PM
  4. Browse Virtual Earth and Win a Zune Contest Starts NOW!
    By Virtual Bird's Eye in forum News and Announcements
    Replies: 0
    Last Post: 11-14-2008, 02:16 PM
  5. VB .NET is so slow!
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 07-28-2004, 04:17 AM

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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123