spacer1
spacer2 1_1 1_2
2_1
 Subscribe
 The MP2K Update!
 
 
 
 Magazine
Front Cover
What's New
Articles
News
Sample Data
Gallery
Advertise
About
 Features
MapPoint 2013
Press Releases
MapPoint Forums
Companies
Link to MP2Kmag
Wish List
MapPoint Trial
Authors
 Earlier Content
Past News Items
Past What's New Announcements
 Sponsors
 Order

MapPoint 2013

Programming MapPoint in .NET

MapPoint Book

  Spatial Community
SVG Tutorials
MapPoint

Map Visitors

  MAPPOINT Q & A  

Top | Post New Question | Read All | MP2K Asks Microsoft

600 kurt - February 14, 2002

Say I import a data file containing company names, addresses, and number of employees at each address. How can i draw a polygon around a subset of these companies and find out total employees inside the polygon? (I know i could do Export to Excel each time i draw the polygon, then add the total within Excel, but I would like to eliminate that step and see the total while still in MapPoint).

Answer:

Use the "QueryShape" method. From MapPoint 2002 help for this method:

    'Find records in shape
    objshape.Select
    Set objRecords = objDataSet.QueryShape(objshape)
    objRecords.MoveFirst
    Do While Not objRecords.EOF
      lngCount = lngCount + 1
      objRecords.MoveNext
    Loop
    MsgBox "Number of records in shape: " & lngCount
So, you'd have to be able to identify the shape that you want to query, or you could do this for all Shapes having geoFreeform as a type. Then replace the accumulation of records with an accumulation of the employees field.

- Walt Cygan

Post New Answer / Follow-up


Google
 
MP2Kmag Internet


 Recent Discussion
 Resources


Want Your Site To Appear Here?

   © 1999-2012 MP2K. Questions and comments to: website@mp2kmag.com
  Microsoft and MapPoint 2002/2004/2006/2009/2010/2011/2013 are either trademarks or registered trademarks of Microsoft.