Posted By: BeSharp | Sep 7th, 2008 @ 2:58 AM
page 1 of 1
Comments: 10 | Views: 1615
Can anybody recommend either a Web Service or an offline database solution which would allow me to get the city and country for any given latitude and longitude?

(Free solutions/services preferred but possible commercial solutions are welcome, too!)

-Ralf

ZippyV
ZippyV
Fired Up
With that topic I did find a list but it didn't end up on Channel 9.

But I found it back:
http://earth-info.nga.mil/gns/html/namefiles.htm
ZippyV
ZippyV
Fired Up
Don't be too euphoric, the lists are not clean and contain other things like mountains, rivers, lakes. It's almost impossible to get a clean list of only cities and villages based on filtering the other columns.
figuerres
figuerres
???
one interesting thing:

http://maps.google.com/maps?ll=27.950739,-82.459259  will give you a map of tampa, fl

when dealing with locations your database would need to have it updated often as names and countries do chnage.

another issue is how you determine the "city" from LL
LL math to find the distance between two locations can get a bit complex,  as I recall it's called the Great Circle formla as it takes the cuve of the earth into account.

given a point and a distance you may get multiple location names, if several have non-zero distance and are very close which one do you pick?

That activity is called reverse geocoding . Do a google search and you can find loads of free choices. It is possible to do it with the map point web service as demonstrated here
http://virtualearth.spaces.live.com/blog/cns!2BBC66E99FDCDB98!536.entry?wa=wsignin1.0
Mark Brown
Mark Brown
Microsoft Web Platform
Yes, Virtual Earth provides a reverse geocoding service in the platform API.

You can see this in our Interactive SDK, http://dev.live.com/virtualearth/sdk expand "Find Information (Basic)", then click on "Reverse Find"

MSDN Library for this, http://msdn.microsoft.com/en-us/library/cc469978.aspx

You'll have the parse the output if you just want city/state but that's pretty trivial.

Enjoy.
If you just want the list, Check the World Wide Telescope. It has the long list of cities with lat & long which again might be based on Virtual Earth only.
page 1 of 1
Comments: 10 | Views: 1615
Microsoft Communities