Community of MapPoint and Virtual Earth Users and Developers
This is a discussion on How to find nearest city? within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi all, I work with MS MapPoint 2002 under Delphi using TOleContainer. Everything works fine, but I have this problem: ...
| |||||||
| Today's Posts | Twitter Feed | Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| How to find nearest city? I work with MS MapPoint 2002 under Delphi using TOleContainer. Everything works fine, but I have this problem: I have Lat and Long and want to search for nearest city. I need name of the city and name of the country, where it resides. I use this code: Code: Dist:= 1; Loc:= self.GetLocation(X, Y); Results:= Loc.FindNearby(Dist); while (Results.Count = 0) and (Dist < CMaxDist) do begin Results:= Loc.FindNearby(Dist); Dist:= Dist*2; end; if Results.Count > 0 then //here I have all locations ... Thanks for all replies. Bye Petr |
| ||||
|
One of the problems with the FindNearby method is results are limited to the CURRENTLY VISIBLE PlaceCategory objects (Like Restaurants, Airports etc..) So even if there is/was a way to get the city from the nearest "Place" the results could not be depended on. A better approach might be what David is exploring (Also Delphi). http://www.mp2kmag.com/mappoint/disc...pic.asp?t=3187
__________________ John http://www.support-pc.com Order MapPoint 2006 Here https://secure.mp2kmag.com/?refer=support-PC |
| |||
|
Hi Petr, as said above I am doing the same sort of thing although I am searching for the nearest road from a point so I can get a postcode. The Map.ObjectsFromPoint method: Code: mpResults := mpMap.ObjectsFromPoint(mpMap.LocationToX(mpLocation), mpMap.LocationToY(mpLocation));
__________________ "If it ain't broke don't fix it!" |
| ||||
|
Ran accross this on MSDN ZIP Code - City Finder Sample Code http://msdn.microsoft.com/library/de...asp?frame=true
__________________ John http://www.support-pc.com Order MapPoint 2006 Here https://secure.mp2kmag.com/?refer=support-PC |
![]() |
| Tags |
| city, find, nearest |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to retrieve nearest city from longitudes and latitud | fsarraj | MapPoint 2006/2009 Discussion | 3 | 03-08-2006 12:22 PM |
| find nearest locality | Anonymous | MapPoint 2006/2009 Discussion | 0 | 07-09-2003 03:26 AM |
| nearest city of a point | Anonymous | MapPoint 2006/2009 Discussion | 0 | 04-07-2003 06:46 AM |
| Find city which are placed to x km or miles of a place | Anonymous | MapPoint 2006/2009 Discussion | 0 | 12-09-2002 07:11 AM |
| Given a city find zip codes? | amanuel | MapPoint 2006/2009 Discussion | 0 | 09-21-2002 12:32 PM |
Menorca Holiday
Enjoy a Menorca holiday at a great rate when booked through UlookUbook!