MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Getting Information Back from MapPoint

This is a discussion on Getting Information Back from MapPoint within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I have several polygons displayed on a MapPoint map. I am creating pushpins for various locations that are displayed on ...


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

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  14 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 10-07-2007
Junior Member
White Belt
 
Join Date: Oct 2007
Posts: 2
Getting Information Back from MapPoint

I have several polygons displayed on a MapPoint map. I am creating pushpins for various locations that are displayed on the map. Is there a way to get information back (preferably into Access) as to what polygon a particular address is within? Or even a list of pushpins that are within a particular polygon.

Thanks
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 10-07-2007
Eric Frost's Avatar
Senior Member
Black Belt
 
Join Date: Jul 1992
Posts: 2,322
Blog Entries: 1
Re: Getting Information Back from MapPoint

Hi! Welcome to the forum. I hope you find it useful and stick around.

You can select a polygon and then right click on it and "Export To Excel" the list of pushpins within it... you could then import the lists to Access.

If you are programming it, you can use the QueryShape or QueryPolygon method to get a recordset and loop through it and write back to Access.. see the Help File for more info on the Query methods and example code.

e.g. for QueryPolygon

Code:
Sub QueryRecordsInBoxAtCenterOfMap()
    Dim objApp As New MapPoint.Application
    Dim objMap As MapPoint.Map
    Dim objDataSet As MapPoint.DataSet
    Dim objRecords As MapPoint.Recordset
    Dim objLocs(1 To 5) As MapPoint.Location
    Dim lngCount As Long
    
    'Set up application and objects to use
    Set objMap = objApp.ActiveMap
    lngCount = 0
    'create a "square" of locations in the middle of the map
    objMap.Altitude = objMap.Altitude / 2
    Set objLocs(1) = objMap.XYToLocation(0, 0)
    Set objLocs(2) = objMap.XYToLocation(objMap.Width, 0)
    Set objLocs(3) = objMap.XYToLocation(objMap.Width, objMap.Height)
    Set objLocs(4) = objMap.XYToLocation(0, objMap.Height)
    Set objLocs(5) = objMap.XYToLocation(0, 0)
    objMap.Altitude = objMap.Altitude * 2
    
    objApp.Visible = True
    objApp.UserControl = True
    
    'Remove the comment from the next line to see the polygon being queried
    'objMap.Shapes.AddPolyline objLocs
    
    'Let user create a data map
    Set objDataSet = objApp.ActiveMap.DataSets.ShowImportWizard

    'Find records in polygon
    Set objRecords = objDataSet.QueryPolygon(objLocs)
    objRecords.MoveFirst
    Do While Not objRecords.EOF
        lngCount = lngCount + 1
        objRecords.MoveNext
    Loop
    MsgBox "Number of records in polygon: " & lngCount
End Sub
Eric
__________________
~ Now taking orders for MapPoint 2009 ~
~
~ Upgrade to MapForums Plus membership ~
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 10-08-2007
Junior Member
White Belt
 
Join Date: Oct 2007
Posts: 2
Re: Getting Information Back from MapPoint

Thanks for the reply. I am currently doing the export to Excel and have the Excel file linked to the Access database but that is a little cumbersome for the end user. Also, the data exported to Excel does not contain the polygon information, so I have to manually export to Excel for each polygon.

I have used the help file and the sample code and I can query a polygon to get a count of how many records are within that polygon, but I want to know exactly what records they are. Here is what I want to do:

I have an Access table that has addresses where crime shave occurred. I have a MapPoint map that has polygons that represent political boundaries. I can plot the crime locations on the map and query the map to see how many crimes occurred in a specific polygon. I want to be able to create code that will query the polygons to get a list of the crimes that are in that polygon so I can store the polygon information with the crime data in Access. This will allow me to prepare crime statistics for each polygon.

Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 10-08-2007
Eric Frost's Avatar
Senior Member
Black Belt
 
Join Date: Jul 1992
Posts: 2,322
Blog Entries: 1
Re: Getting Information Back from MapPoint

This is the part that loops through each one..

Code:
    objRecords.MoveFirst
    Do While Not objRecords.EOF
        lngCount = lngCount + 1
        objRecords.MoveNext
    Loop
As written all the code does is get the count, but you could access the location information from the objRecords recordset object.. I think use the Pushpin property e.g.

Code:
  'Access the first Pushpin
  MsgBox objRS.Pushpin.Name
  objRS.Pushpin.Location.GoTo
If you want help with the coding, there are probably some people in here who would be happy to do some consulting..

Eric
__________________
~ Now taking orders for MapPoint 2009 ~
~
~ Upgrade to MapForums Plus membership ~
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


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/getting-information-back-mappoint-6512.html

Posted By For Type Date
Microsoft MapPoint 2006 - MP2K Magazine This thread Refback 10-13-2007 07:43 AM
Pushpin Tool Add-in - MP2K Magazine This thread Refback 10-12-2007 10:57 AM
Programming MapPoint in .NET - MP2K Magazine This thread Refback 10-12-2007 10:38 AM
Formatting Coordinates with DmsFormat - MapPoint Articles - MP2K Magazine This thread Refback 10-10-2007 07:38 AM
A More Compact Method for Obtaining Lat/Long - MapPoint Articles - MP2K Magazine This thread Refback 10-10-2007 07:33 AM
html » Getting Information Back from MapPoint This thread Pingback 10-09-2007 03:15 PM
Reverse Geocoding with MapPoint 2002 - MapPoint Articles - MP2K Magazine This thread Refback 10-09-2007 08:49 AM
A More Compact Method for Obtaining Lat/Long - MapPoint Articles - MP2K Magazine This thread Refback 10-09-2007 08:48 AM
Using MS MapPoint in PowerBuilder - MapPoint Articles - MP2K Magazine This thread Refback 10-08-2007 10:52 PM
Using Geographic Codes to Import Data into MapPoint 2004 - MapPoint Articles - MP2K Magazine This thread Refback 10-08-2007 03:08 PM
Reverse Geocoding, Another Method - MapPoint Articles - MP2K Magazine This thread Refback 10-08-2007 10:11 AM
Converting Strings Into Decimal Degree Format - MapPoint Articles - MP2K Magazine This thread Refback 10-08-2007 10:08 AM
Working With Excel and MapPoint - MP2K Magazine This thread Refback 10-08-2007 10:06 AM
Forth Worth and Surroundings - MapPoint 2004 Guide - MP2K Magazine This thread Refback 10-08-2007 09:01 AM

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
Atlas Is Back smiller News and Announcements 0 07-25-2006 02:59 PM
Data2Map is back! dkrafcheck News and Announcements 0 05-15-2006 09:11 AM
MapPoint information law MapPoint Web Service and Virtual Earth 1 06-14-2005 05:12 PM
Delphi/Mappoint - Modal Form looses Focus & sent to back PinnacleDev MapPoint 2006/2009 Discussion 2 12-06-2004 10:35 AM
lat lon conversion from mappoint format back to gps sentence Anonymous MapPoint 2006/2009 Discussion 1 09-10-2002 12:42 PM


All times are GMT -5. The time now is 10:39 AM.


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

Prague Flights
Aside from a good nightlife Prague has magnificent architecture from its industrial past. Book Prague flights for great value at Holiday Hypermarket.

Honeymoon Holidays
Book your Honeymoon holiday with Travel Counsellors. A personal advisor will help you plan the perfect honeymoon holiday.

Holidays in Italy
Holidays in Italy boast some stunning countryside as well as a beautiful coastline. You can even visit an active volcano like Stromboli or Etna. Book at dealchecker.co.uk.

Holidays to Bahamas
Choose from a number of extraordinary holidays to the Bahamas at The Holiday Place. See pictures of these beautiful islands online.

Cheap Turkey Holidays
The best time of year to sneak in cheap Turkey holidays is during the off-peak season. Check out the great deals available during April, May or October. For other tips on how to bag a great value holiday simply check online at ulookubook.com

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

Cheap Goa Holidays
Experience the world famous Wednesday Flea Market at Anjuna! Book cheap Goa 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