Counting points within drivetime zone

Anonymous
11-12-2003, 08:58 PM
Hi,

I've plotted a number of points and have created drivetime zones around certain ones. Now, I'd like to be able to see what % of the total plotted points fall within the drivetime zone. How can I do that? Please help, I really need it!

John Meyer
11-17-2003, 08:03 AM
Maria,

Here is a VB sample to get you started. Put some pushpins in Tampa, FL for the test. Hope this helps.

Dim objmap As MapPointCtl.Map
Dim objDataSet As MapPointCtl.DataSet
Dim objRecords As MapPointCtl.Recordset
Dim objshape As MapPointCtl.Shape
Dim lngCount As Long
Dim objloc1 As MapPointCtl.Location
Dim aDriveTimeZone As MapPointCtl.Shape

Set objmap = MappointControl1.ActiveMap
Set objloc1 = objmap.FindResults("Tampa, FL").Item(1)
Set objshape = objmap.Shapes.AddDrivetimeZone(objloc1, 20 * geoOneMinute)
objshape.Select

For Each objDataSet In objmap.DataSets
Set objRecords = objDataSet.QueryShape(objshape)
objRecords.MoveFirst
Do While Not objRecords.EOF
lngCount = lngCount + 1
objRecords.MoveNext
Loop
Next
MsgBox "Number of records in shape: " & lngCount

 
Web mp2kmag.com
mapforums.com