MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Plotting Pushpins

This is a discussion on Plotting Pushpins within the MapPoint 2006/2009 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 ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-07-2006
Member
Yellow Belt
 
Join Date: Dec 2004
Posts: 44
Exclamation Plotting Pushpins

Hi,
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?

Regards,
Gianmaria
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 09-07-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,055
Hi,

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 09-08-2006
Junior Member
White Belt
 
Join Date: Sep 2006
Posts: 6
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.

Code:
 
DataRow dr;
//Write the CSV file.
//Open the file in the application path.
 
TextWriter txtw = new StreamWriter(Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName) +
"\\temp.csv",false);
//Write the Column Header
txtw.WriteLine("Lat;Lon");
for (int k=0;k<dt.Rows.Count; k++)
{
dr = dt.Rows[k];
Lat = (double) dr["Lat"];
Lon =(double) dr["Lon"];
txtw.WriteLine(Lat.ToString()+";"+Lon.ToString());
}
txtw.Close();
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", 
fieldSpecifications, 
MapPoint.GeoCountry.geoCountryItaly,
MapPoint.GeoDelimiter.geoDelimiterSemicolon, 0);
oDS.Symbol = 37;
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Map Point VBA - Plotting circles Phil Holt MapPoint 2006/2009 Discussion 2 02-05-2006 05:33 AM
plotting pushpin limitations Anonymous MapPoint Web Service and Virtual Earth 2 11-11-2004 11:57 AM
GPS Data plotting on the Map sm176811 MapPoint 2006/2009 Discussion 2 03-08-2003 02:24 PM
I am plotting the different address in mappoint in US . PeriSen MapPoint 2006/2009 Discussion 1 09-12-2002 02:11 PM
I am interfacing Mappoint with VB. I am plotting .... Anonymous MapPoint 2006/2009 Discussion 2 06-10-2002 01:58 PM


All times are GMT -5. The time now is 07:42 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map

Cheap flights to Antalya
Book cheap flights to Antalya using Holiday Hypermarket's search. You'll be on your way to Turkey's Sunny Southern Coast in no time.

Travelcounselors
TravelCounsellors are a Queens award winning Travel Agent. Have a personal Travel Counselor help with your travel plans.

Holidays to Thailand
The best cultures and backgrounds make Thailand an interesting and memorable country to visit. Book great value holidays to Thailand online at dealchecker.co.uk.

Holidays in Dubai
Holidays in Dubai are an eclectic mix of the ancient and the modern. Discover an oasis of luxury amid the Arabian desert. Book here now!

Cheap Spain Holidays
Stay well informed when you are searching for cheap holidays online. For useful advice on when to book cheap Spain holidays make sure you look on ulookubook.com

Inclusive Holidays
At Travel.co.uk travel comparison will help you plan the perfect inclusive holidays.

Fuerteventura Holidays
Visit one of the closest Canary Islands to Africa! Book Fuerteventura holidays at On The Beach!


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