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

Plotting Pushpins

This is a discussion on Plotting Pushpins within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hi, a question: I have to trace a full route made of lat/lon positions over the map. Numer of points ...

  1. #1
    Gianmaria is offline Member Yellow Belt
    Join Date
    Dec 2004

    Exclamation Plotting Pushpins

    a question:

    I have to trace a full route made of lat/lon positions over the map. Numer of points may vary from 1 to much more as 30.000 or more.

    I use this code cycling on a datatable:

    MapPoint.Pushpin pushpin = this.mMap.AddPushpin(this.mMap.GetLocation(Convert .ToDouble(lat]), Convert.ToDouble(lon), 1), Convert.ToDateTime(theTime).ToLocalTime().ToString ());

    pushpin.Symbol = 133;

    problem is that this operation is very slow on plotting.....
    any idea to make it faster?


  2. #2
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004

    You can speed up a little to not do the conversions whilst plotting but to convert when you got the data before you store it, however the main slowness is the plotting itself.

    I suggest to only display what needed. Nobody can see thousands of pushpins on a map, so you can display only what is in view and eventually depending on zoom level. I mean if zoom level is so that all 30000 pushpins are in view, you can as wel display 100, nobody will see the difference. If zomming in then you display waht is in view etc.

    Needs a little thinking and a some smart algoritm to do this but sure to do.

  3. #3
    masty is offline Junior Member White Belt
    Join Date
    Sep 2006
    Hi Gianmaria,

    I also need to plot a large number of pushpins in a map. I found this solution which increase a lot the speed of drawing pushpins. Anyway I also use the trick suggested by Wilfried.. only plot the points that really need.
    The first suggestion is: don't use the AddPushPin method... it's good for a very few number of pushpins... otherways it takes too much time.
    Use the ImportData method as shown in the follow example:

    I suppose to have a DataTable (dt) with two columns. The first contains the Latitude, the second the Longitude as double data type.
    From the DataTable I create first a CSV file, which consists in a list of rows with Latitude and Longitude separated by a semicolon.
    Then I create a MapPoint DataSet object with the Method ImportData.
    Finally I choose the symbol of the PushPins.

    Hope this helps.

    Everything can go faster if you use a RamDisk to save/read the CSV.

    If you want to know the alghortim I used to decide which and how many points are anough for the users... just ask me.

    DataRow dr;
    //Write the CSV file.
    //Open the file in the application path.
    TextWriter txtw = new StreamWriter(Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName) +
    //Write the Column Header
    for (int k=0;k<dt.Rows.Count; k++)
    dr = dt.Rows[k];
    Lat = (double) dr["Lat"];
    Lon =(double) dr["Lon"];
    MapPoint.DataSet oDS;
    //Define field specification
    object[,] fieldSpecifications = null;
    fieldSpecifications = new object[2,2];
    //Specify what fields are geographic and what fields are not
    fieldSpecifications[0,0] = "Lat";
    fieldSpecifications[0,1] = MapPoint.GeoFieldType.geoFieldLatitude;
    fieldSpecifications[1,0] = "Lon";
    fieldSpecifications[1,1] = MapPoint.GeoFieldType.geoFieldLongitude;
    oDS = map.DataSets.ImportData(Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName) + "\\temp.csv", 
    MapPoint.GeoDelimiter.geoDelimiterSemicolon, 0);
    oDS.Symbol = 37;

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Map Point VBA - Plotting circles
    By Phil Holt in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 02-05-2006, 05:33 AM
  2. plotting pushpin limitations
    By Anonymous in forum Bing Maps and MapPoint Web Service
    Replies: 2
    Last Post: 11-11-2004, 11:57 AM
  3. GPS Data plotting on the Map
    By sm176811 in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 03-08-2003, 02:24 PM
  4. I am plotting the different address in mappoint in US .
    By PeriSen in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 09-12-2002, 02:11 PM
  5. I am interfacing Mappoint with VB. I am plotting ....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 06-10-2002, 01:58 PM

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