Community of MapPoint and Virtual Earth Users and Developers
This is a discussion on Sum of Items within a Radius? within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Relatively new to mappoint - question is this: IS there a way to count up the number of items within ...
| |||||||
| Today's Posts | Twitter Feed | Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Sum of Items within a Radius? IS there a way to count up the number of items within a selected radius? I am asking this to find a way to count sales within a radius or any item. I know mappoint can sum the imported data through metro areas, but I didn't know if there was a way within mappoint, or a plugin or tool, that would allow me to do this. thanks! mc |
| |||
|
Hi, Yes very easy to do. I just made this testcode to see if it works: Code: private void selectedareaToolStripMenuItem_Click(object sender, EventArgs e)
{
MapPoint.SelectedArea sa = MP.ActiveMap.SelectedArea;
Location[] loc = new Location[5];
loc[0] = MP.ActiveMap.XYToLocation(sa.Left, sa.Top);
loc[1] = MP.ActiveMap.XYToLocation(sa.Left + sa.Width, sa.Top);
loc[2] = MP.ActiveMap.XYToLocation(sa.Left + sa.Width, sa.Top + sa.Height);
loc[3] = MP.ActiveMap.XYToLocation(sa.Left, sa.Top + sa.Height);
loc[4] = loc[0];
MP.ActiveMap.Shapes.AddPolyline(loc);
int PPCount = 0;
foreach (MapPoint.DataSet ds in MP.ActiveMap.DataSets) {
MapPoint.Recordset rs = ds.QueryPolygon(loc);
rs.MoveFirst();
while (!rs.EOF) {
PPCount++;
rs.MoveNext();
}
}
Console.WriteLine("Record count " + Convert.ToString(PPCount));
}
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
![]() |
| Tags |
| items, radius, sum |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| MapPoint Wish List Items | Harv | Wish List | 1 | 07-08-2003 01:28 PM |
| Remove items from the menu | Zanzibar | MapPoint 2006/2009 Discussion | 0 | 12-23-2002 04:39 AM |
| Non Mapped Items | Anonymous | Wish List | 0 | 12-17-2002 02:33 AM |
| Not mapped items | Anonymous | Wish List | 0 | 11-15-2002 12:18 PM |
| After you geocode a list of items from an excel fi.... | Anonymous | MapPoint 2006/2009 Discussion | 1 | 06-29-2000 07:00 PM |
Dalaman Holiday
Enjoy a wonderfully peaceful Dalaman holiday... Book through UlookUbook and save!