Top |
Post New Question |
Read All |
MP2K Asks Microsoft
669
Jonathan Martin
-
May 13, 2002
I am wondering if anyone has built a COM add-in application or has written VB code that will query two sets of data in MapPoint 2002 and determine whether the locations of dataset 1 (imported address info from excel) are within a given radius of dataset 2 (also imported address info from excel)
Would like to eventually create a form that accepts the following inputs:
DATASET 1: user may select a dataset already imported to the current MapPoint file
DATASET 2 same operation as dataset 1
RADIUS: the distance in miles from the data points within dataset 1 that will be used to find the data points within dataset 2.
OUTPUT FILENAME: allows the user to specify the filename of a new excel file where the results of the query will be stored.
I am guessing that the records from dataset 1 would have to be converted to lat/long in order to create the radius and capture the resulting pushpins from dataset 2?
Appreciate any response that might help me address and solve this problem
Regards,
Jonathan Martin
Answer:
I don't know of anyone who has specifically done this, but it certainly can be done. The only question would be performance, which would mostly depend on the size of the datasets. If dataset 1 has x records and dataset 2 has y records, you'd have to do x*y calculations of distance.
While lat/lon would be helpful for importing the data, it is not necessary. The Distance method will work using the Location objects of any 2 Pushpins. Check the programming help documentation. This assumes you want a crow's flight distance. If you want a driving distance, you will need to create a route by adding pushpins as waypoints, then calculating the route and reading the Distance property.
- Walt Cygan
Post New Answer / Follow-up