MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Exporting data from multiple radii

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


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

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



Click here to register

Reply

 

LinkBack (1) Thread Tools Display Modes
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 10-23-2008
Junior Member
White Belt
 
Join Date: Oct 2008
Posts: 4
Exporting data from multiple radii

I found some similar questions to this but I did not find the answers. I am hoping someone out here can help me.

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.
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-28-2008
Senior Member
Green Belt
 
Join Date: Oct 2003
Location: London
Posts: 118
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
Then the circles were drawn around each branch location

Code:
Do While nShapeIndex <=     ....the number of branches
  Set objShape(nShapeIndex) = objMap.Shapes.AddShape(geoShapeOval, objBranchLoc(nShapeIndex), CircleDiam, CircleDiam)
  objShape(nShapeIndex).Name = BranchName(nShapeIndex)
Then to output the address data for all the customers falling in a branch circle, loops were used to go to each circle, to go to each record one-by-one and then to go to each datafield one-by-one. Because I knew what data value was in each field I used SELECT CASE to assign it correctly to the output column.

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
Well it did work for me – I’m not 100% certain all the time exactly why!! Hope this experience helps.
__________________
David
MapPoint Europe Gallery at http://www.broomanalysis.plus.com/gallerylist.html
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
data, exporting, multiple, radii


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/exporting-data-multiple-radii-8963.html

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

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


All times are GMT -5. The time now is 09:03 PM.


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


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