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
Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 21

route drawing too slow for many locations

This is a discussion on route drawing too slow for many locations within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hi, You can select the whole dataset and then go trough all pushpins and change the symbol. I dont know ...

  1. #11
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: route drawing too slow for many locations

    Hi,

    You can select the whole dataset and then go trough all pushpins and change the symbol. I dont know how fast it will be, but I think it also take a few seconds.

    You can also use AddPushPin and set eacht symbol, but it will be slower for such amount I think. Note that the speed is depending, if you use same name or empty name then it is slower, with exclusive name for each pushpin it is faster.

  2. #12
    VC_Man is offline Member Green Belt
    Join Date
    Nov 2006
    Posts
    93

    Re: route drawing too slow for many locations

    Hi Wilfried,

    Thank you for your reply. Well I already use DataSet to keep all the pushpins of one target. For another target I created another DataSet. To give/change all the pushpin a symbol I draw for each pushpin a seperate symbol, save it to disk and import it to Mappoint form disk again.

    Well suppose I have 1000 pushpins, while each pushpin's symbol is about 5 kB, than this results in importing 5 MB of symbols data. That would be very cpu-consuming. So I thought using DataMap would do some trick which makes it much faster, after I read your post to Gucelli.

  3. #13
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: route drawing too slow for many locations

    Hi,

    Keep the custom symbols size as small as possible. For example around 500 bytes should be possible (a background with a number for example).

    Another point to consider is that you probably normally dont need to draw such amount of pushpins. 1000 pushpin on screen then no one of it is selectable (if that it the intention of course). So eventually you draw amount only if in view and also depending on zoom level. This can save time also.

  4. #14
    VC_Man is offline Member Green Belt
    Join Date
    Nov 2006
    Posts
    93

    Re: route drawing too slow for many locations

    Hi Wilfried,

    That is what I also thought of, I found out that in real situation, it isn't usefull to plot over hundreds or thousands of pushpin on the map. I've already implemented something like a trace, which draws a simple line to the next pushpin.

    So to draw pushpins, I want to do that only when I zoom in, to make it less cpu consuming, because of less pushpins to draw. But how can I draw only pushpins in a certain view? Thank you.

  5. #15
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: route drawing too slow for many locations

    Hi,

    It is depending on your application. But 1 thing is easy, that is to draw only what is in view. You have the ActiveMap.Location object, that is the center of the window. Then you can do 2 thing, perfect is to calculate the coordinates of top, left, bottom, right and draw in map only pushpins in view, or you can make an assumption that a user's window is more or less 2/3 height/width (which is in most case more or less true) and calculate in function of the Altitude.

    Then if altitude is large you can skip a lots of pushpins because they will too close together. This is more difficult and depending on your application. If you know the average distance between the pushpins you can make an algoritm that skips 1/2/3/more depending on Altitude and only display all pushpins (in view) starting from a certain zoom level.

  6. #16
    VC_Man is offline Member Green Belt
    Join Date
    Nov 2006
    Posts
    93

    Re: route drawing too slow for many locations

    Thank you for your reply Wilfried,

    So it's a bit of difficult construction to implement to show only the pushpin in the view. I need some time to do that. Thank you Wilfried.

  7. #17
    VC_Man is offline Member Green Belt
    Join Date
    Nov 2006
    Posts
    93

    Re: route drawing too slow for many locations

    I've some suggestions about how to slove the problem I came with the previous post. To get the size of the view in Locations is to convert the top, bottom, left and right from pixels to Locations. Than retrieve all the psuhpins from the recordset and compare wether each pushpin is inside the top, bottom, left and right in Locations of the view. If so, than draw the pushpin on the map, if not than don't draw it. In this case you don't need the ALtitude right. The problem with altitude is you don't know it if you use ZoomIn(), ZoomOut(). Because you simply don't get the results back in ZoomLevel or Altitude.

    The other problem is if I'm in a high Altitude, I don't want to see pushpins overlapping each other and look like a mess. To solve that I don't know how to begin, but one problem is that I don't get the pushpins on a hierarchical way form RecordSet. So what do you think?

  8. #18
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: route drawing too slow for many locations

    Hi,

    The in/out of view you propose seems to me the best way to do.

    The altitude problem is indeed somewhat more difficult. If it is a route from vehicles then it is simple, you just calculate the distance between current pushpun that you plot and next one. Depending on altitude you plot it or skip it.

    But if there is no logic in the sequence of the pushpins then it becaumes more difficult. You could have some lists in your program holding pushpin sets for some altitudes, but the problem is the algoritme to make them. If I come up with some idea (even if it is stupid) then I come back

  9. #19
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: route drawing too slow for many locations

    Hi,

    In case there is no direct logic you can use 2 things. You can befor you plot a pushpin use ObjectsFromPoint. If the returned collection contains a pushpin then you dont plot. ObjectsFromPoint will return pushpins that are very nearby the point you want.

    The other option is to use FindNearby for each pushpin you want to plot, but then you have to make a little algoritm to have the distance in function of the Altitude level.

  10. #20
    VC_Man is offline Member Green Belt
    Join Date
    Nov 2006
    Posts
    93

    Re: route drawing too slow for many locations

    Hi Wilfried,

    Thank you for your reply.
    Wilfried, to draw custom symbols for my pushpins, I parse the information from the balloontext. There is also the number of pushpin as ID, which is on a hierachical manner. So it starts with 1 and than 2 and than........xxx. This means I can rearrange them and than skip some drawings right?

    The only problem than is how to get the pushpins from the view? Suppose I've zoomed in a part of the map with only a part of all the pushpins in it. Than I need to get those pushpins within the map, is that possible? Also what is the relation between the altitude and the distance in meters on the map.


    And last serious question, is there a limitation of loading custom symbols? Cause I've about more than 200 symbols loaded, but suddenly it says "Failed to import".

    Wilfried, could it be because everytime I load a custom symbol with the same name, mappoint gets so slow with loading custom symbols? That reminds me at the beginning when I loaded pushpins with the same name.

    I know it's a lot of questions, but than I'm almost finished and overcome all the problems. Thank you.

Page 2 of 3 FirstFirst 123 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Find all exact locations along a route
    By PorkChopper in forum MapPoint Desktop Discussion
    Replies: 5
    Last Post: 07-14-2009, 02:56 PM
  2. Slow response time on route requests
    By cgoudy in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 01-25-2007, 08:36 AM
  3. Drawing more than one route at a time
    By chpw in forum MapPoint Desktop Discussion
    Replies: 6
    Last Post: 02-28-2006, 04:20 AM
  4. Drawing route as I go.
    By z_darius in forum MapPoint Desktop Discussion
    Replies: 6
    Last Post: 02-10-2006, 09:57 AM
  5. MapPoint Route Drawing
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 10-21-2002, 10:05 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