Community of VE/MapPoint Users and Developers
This is a discussion on Exporting data from multiple radii within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I found some similar questions to this but I did not find the answers. I am hoping someone out here ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Exporting data from multiple radii I have a map with 400 + radii. I need to export the data within each radius to excel. Mappoint makes you do this one at a time. I believe there should be a way to get into the spreadsheet and export all the data for all of the shapes at the same time. Possibly through Excel and VB. I am sure someone out there has figured this out, I just could not find it anywhere. Any help would be greatly appreciated. Thank you, Dow. |
| |||
| Re: Exporting data from multiple radii
Possibly this experience might help. I had a situation where I was dealing with a c-store chain with around 170 branches. Based on a promotion the retailer had collected 14,000 customer addresses and for each store wanted to identify those customers in a 5km radius. I managed to get it to work using excel vba and the following approach. First create two dataset objects using AddPushpinSet for the branch and customer data. For example for the customer data there were 7 columns (customer number, address1, address2, city, postcode, latitude, longitude) and this was read in using Code: Sub LocateCustomers()
Set objCustomerDS = objMap.DataSets.AddPushpinSet("Customer Locations")
zDataSource = "C:\....\vba_excel example.xls!FoundAddresses!A1:...whatever"
Set objCustomerDS = objDS.ImportData(zDataSource)
End Sub
Code: Do While nShapeIndex <= ....the number of branches Set objShape(nShapeIndex) = objMap.Shapes.AddShape(geoShapeOval, objBranchLoc(nShapeIndex), CircleDiam, CircleDiam) objShape(nShapeIndex).Name = BranchName(nShapeIndex) Code:
'Output Customer data for each catchment
'Titles for Output columns in excel
Worksheets("Circles Around Branches").Cells(1, 1).Value = "Branch"
Worksheets("Circles Around Branches").Cells(1, 2).Value = "Address1"
Worksheets("Circles Around Branches").Cells(1, 3).Value = "Address2"
Worksheets("Circles Around Branches").Cells(1, 4).Value = "City"
Worksheets("Circles Around Branches").Cells(1, 5).Value = "Postcode"
Worksheets("Circles Around Branches").Cells(1, 6).Value = "Latitude"
Worksheets("Circles Around Branches").Cells(1, 7).Value = "Longitude"
nShapeIndex = 1
nCurrentRow = 1
Do While nShapeIndex <= .....the number of branches
Set objRecords = objCustomerDS.QueryShape(objShape(nShapeIndex)) 'start with first circle, querying the customer dataset
objRecords.MoveFirst
Do While Not objRecords.EOF
numFields = 0
nCurrentRow = nCurrentRow + 1
For Each objField In objRecords.Fields
numFields = numFields + 1
vals = CStr(objField.Value)
Worksheets("Circles Around Branches").Cells(nCurrentRow, 1).Value = objShape(nShapeIndex).Name
Select Case numFields
Case 1
Worksheets("Circles Around Branches").Cells(nCurrentRow, 2).Value = vals
Case 2
Worksheets("Circles Around Branches").Cells(nCurrentRow, 3).Value = vals
Case 3
Worksheets("Circles Around Branches").Cells(nCurrentRow, 4).Value = vals
Case 4
Worksheets("Circles Around Branches").Cells(nCurrentRow, 5).Value = vals
Case 5
Worksheets("Circles Around Branches").Cells(nCurrentRow, 6).Value = vals
Case 6
Worksheets("Circles Around Branches").Cells(nCurrentRow, 7).Value = vals
Case 7
Worksheets("Circles Around Branches").Cells(nCurrentRow, 8).Value = vals
End Select
Next objField
objRecords.MoveNext
Loop
nShapeIndex = nShapeIndex + 1
Loop
__________________ David MapPoint Europe Gallery at http://www.broomanalysis.plus.com/gallerylist.html |
![]() |
| Tags |
| data, exporting, multiple, radii |
| ||||
| Posted By | For | Type | Date | |
| The Magazine for MapPoint - MP2K Magazine | This thread | Refback | 10-23-2008 05:00 PM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Exporting Multiple Radii | tjgray06 | MapPoint 2006/2009 Discussion | 3 | 10-19-2007 02:58 PM |
| New user: Exporting multiple data sets to excel | rpone605 | Products: Pushpin Tool, Single State Mapper | 0 | 06-20-2006 04:54 PM |
| creating radii based on highest concentration of pushpins | tvsmvp | MapPoint 2006/2009 Discussion | 1 | 01-31-2006 06:10 AM |
| MapPoint VBA - Radii | Phil Holt | MapPoint 2006/2009 Discussion | 2 | 01-24-2006 08:26 AM |
| exporting data | Anonymous | MapPoint 2006/2009 Discussion | 3 | 02-15-2005 01:06 PM |