MapPoint Forums

MapForums

Community of MapPoint and Virtual Earth Users and Developers




Sum of Items within a Radius?

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


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

Today's Posts Twitter Feed Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-08-2005
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Sum of Items within a Radius?

Relatively new to mappoint - question is this:
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
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 05-09-2005
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,177
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));
        }
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

Tags
items, radius, sum


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


All times are GMT -5. The time now is 02:08 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0 RC2
MP2K Magazine
Visitor Map

Dalaman Holiday
Enjoy a wonderfully peaceful Dalaman holiday... Book through UlookUbook and save!



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