xaxas
06-03-2006, 12:19 AM
Does anybody know how to convert a LatLong to an Address??
Btw I am working in Java, but if you work in any other programming language and know how to do it that will help.
If you don't know how to convert a LatLong to address but to zip code that will work for me as well.
Thank you in advance!
Mohamed
06-03-2006, 05:28 AM
Hi xaxas,
I invite u to do a search in this forum with keys like "reverse geocoding, calcpos, etc. ). You will have the response to your question. As you are a programmer, you can find a lot of posts about that.
Ciao
xaxas
06-03-2006, 04:29 PM
I searched there but I didn't find what I was looking for. :(
Howerver I played a bit with the API and came up with a working idea which gives me the ability to do pretty much everything (search, route etc.) given a GPS location. :lol:
Mohamed
06-03-2006, 05:06 PM
Hi,
There is some Wilfried's posts about that::idea:
Map map = MP.ActiveMap;
Location Loc = map.GetLocation(Lat, Lon, 1);
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);
Console.WriteLine("street " + StreetLoc.StreetAddress.Street);
Console.WriteLine("postcode " + StreetLoc.StreetAddress.PostalCode);
Console.WriteLine("city " + StreetLoc.StreetAddress.City);
}
}
Good night
xaxas
06-03-2006, 05:13 PM
I ran into this piece of code, but in my case (I wanted Java code and there are some major differences) didn't help. Thanks though!
Anyways, I overcame all issues !!! :lol: