Improving the performance of generating pushpins Programmati

kavehmb2000
05-17-2006, 07:34 AM
Hi everyone
I already generated a table containing name,latitude,longitude of a big amount of points. the code i send here works, but it takes a lifetime to generate the pushpins in desired locations. can anyone please hint me on how to reduce the time for generating them?
(it took almost 15 hours to generate about 2500 points while importing the same data in MapPoint got les than 1 min to show!)
[C#]

// here my dataTable is generated
DataTable mydt = DBAccess.ProcessSpecialRoadPoints(itemChecked.ToSt ring());
MapPoint.Map map =this.axMappointControl1.ActiveMap ;
[color=orange]foreach (DataRow drl in mydt.Rows)
{
MapPoint.Location location = map.GetLocation(Convert.ToDouble(drl["LATITUDE"]), Convert.ToDouble(drl["LONGITUDE"]), 1);

MapPoint.Pushpin pin = map.AddPushpin(location, NAME);
[/color]
}
Thanks in advance
KMB

Wilfried
05-19-2006, 12:30 PM
Hi,

Its been a little while I did something in dotNet. But possible the iretation trough the database, also the convertion to double cost a lot of time. I assume you checked the loop already with the conversions, but without the calls to mappoint ?

15 hour seems to me very long for 2500 pushpins.

Did you also try a test in a close loop without any conversion or collention to put 2500 pushpins on the map, eg with slight increments of lat/long to show them ?

kavehmb2000
05-21-2006, 05:48 AM
Dear Wilfried
thank you for your kind answer; actually there is no way I can bypass the conversion to doubles! but, thanks to you again, I could find my answer in this other post of yours!

http://www.mp2kmag.com/mappoint/discussion/viewtopic.asp?t=7507&highlight=pushpin+dataset

 
Web mp2kmag.com
mapforums.com