View Single Post

  #3 (permalink)  
Old 06-16-2005
Wilfried Wilfried is offline
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,112
Re: reverse geocoding

Hi Mark,

Quote:
Originally Posted by markwilding
I have been trying to find an address from gps coordinates for ages with no success,
Try this:

Code:
            double lat = 51.24987;
            double lon = 4.48855;
            Map map = MP.ActiveMap;

            Location loc = map.GetLocation(lat, lon, 1);
            loc.GoTo();

            FindResults streetResults = map.ObjectsFromPoint(map.LocationToX(Loc), map.LocationToY(Loc));

            foreach (object o in streetResults) {
                Location streetLoc = o as Location;
                if(streetLoc != null && streetLoc.StreetAddress != null)
                    Console.WriteLine("value " + streetLoc.StreetAddress.Value);
            }
Reply With Quote