Community of VE/MapPoint Users and Developers
This is a discussion on Find 3 closest matches within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I have to make a website where user can look for the stores closest to their address. So I have ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Find 3 closest matches So I have a database with all the store addresses and I need to find the 3 closest matches to the clients home address. What would be the best approach? I was thinking : - get all latitude and longitude coordinates of the stores and store them locally in a database. - get the latitude and longitude coordinates of the home address of the client - find the 3 nearest matches in the database. Am I thinking in the right way? Thanks for replying! |
| |||
|
Hi, Yes. I assume you mean the most close in a strait line. And to avoid to much calculations (dont know how many stores there are) you kan seek in the database the store with the most close longitude, then also the record with the most close latitude. Then 1 of these 2 is really the most close. So for each of the 3 you have to do 2 database seek and 2 calculations. If you index on lat and an index on long this can go pretty fast.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Quote:
Yes in straight line would do. If I have found those 3 most close stores. How would I get a map from MapPoint on which all 3 stores are located? Is there any function to get like a rectangle from MapPoint? So I could set the boundaries of the rectangle to the two farest stores relative from the users home place. I have been going through the documentation but I couldn't find something like this? How is this done? Thanks again!! |
| |||
|
Hi, Yes, like this: Code: MP.ActiveMap.DataSets.ZoomTo();
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Quote:
Btw. Groeten vanuit Gent! Thanks again! |
| |||
|
Hi, Quote:
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
![]() |
| Tags |
| closest, find, matches |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Find closest between two sets of addresses? | mksql | MapPoint 2006/2009 Discussion | 2 | 08-22-2005 12:49 PM |
| Finding closest 10 locations | Anonymous | MapPoint 2006/2009 Discussion | 1 | 11-19-2003 05:59 AM |