PDA

View Full Version : Round-tripping Street address to LatLong



micnik
09-18-2007, 07:23 AM
Hi!
I Search a location in MapPoint 2006 (European version) using an adress and from the found Location (one hit) I get Latitude and Longitude.
If I later try to use the same Latitude and Longitude to find the street address it only works in some cases and in some other cases I only almost get the same address.
For example:
Streetaddress: Hagagatan 26
City: Stockholm
Country: Sverige

Gives: Latitude = 59.346137568354607 and Longitude = 18.051149575039744

And using that LatLong we get back:
Streetaddress: Hagagatan 23
City: Stockholm
Country: Sverige

Why is this?
Is there no way to do this in an exact way in mappoint,
or is this just a bug in our code?

Regards / Michael

Eric Frost
09-18-2007, 08:09 AM
How are you getting the address from the lat/lon?

Reverse geocoding with MapPoint is not really exact, the reverse geocoding algorithms are just hacks.

I don't think there is any way to do it exactly..

Eric

micnik
09-19-2007, 12:59 AM
Hi Eric!
We use:

Location objLocation = map.GetLocation(latitude, longitude, 1);

objLocation.GoTo();
FindResults mapResults = map.ObjectsFromPoint(map.LocationToX(objLocation), map.LocationToY(objLocation));

If I then look at the mapResults there is only one Location that has a StreetAddress.

Regards / Michael

Eric Frost
09-19-2007, 08:51 AM
Hmm, well I guess it just doesn't work the way you want.

My only thought if you need it would be to maintain a database of your lookups so that when you make the round trip you can refer back to your database first before making a call to MapPoint.

Eric

micnik
09-19-2007, 08:58 AM
OK!
Thanks for your reply.
In my case i got the adress (including Latitude and Longitude) from another application that uses MapPoint and I wanted a way to verify the data that was sent to "my" application.

But I gues that's not possible to do.

Anyway I really appriciate your quick response to my questions.

Regards / Michael