2

I am curious if it is possible to work out what country we are in based on Lat/Long. If for this purpose Germany, France and Belgium are square and we have the corner lat/long for each of the countries, how can we work out of the lat/long that is queried with is within one of these countries.

For example, Google Maps JS API have the ability to set the LatLongBounds and query if anything is in it. Is there anything like it for C# or am I overlooking something?

Thank you for your time,

Qwan

Qwan
  • 157
  • 1
  • 6
  • Is application a webs or a desktop application? Can you assume that your user will always have a working Internet connection? – Ranhiru Jude Cooray Mar 15 '11 at 17:46
  • 1
    Possible Duplicate? http://stackoverflow.com/questions/5154593/country-code-from-a-latitude-longitude-position-without-using-geocoding-services – dana Mar 15 '11 at 17:46

3 Answers3

3

Take a look at Reverse Geocoding

Ranhiru Jude Cooray
  • 19,542
  • 20
  • 83
  • 128
  • +1, beat me to it. Google API is def. the way to go, and they can provide both XML/JSON return objects, which are fully acceptable within C#/.NET. – Brad Christie Mar 15 '11 at 17:49
  • @Brad Christie I actually disagree, ESRI rules the GIS world. You CAN use the Google API, but I find you can do much more with ESRI API's. – jsmith Mar 15 '11 at 17:54
2

Came across this little ditty the other day while looking into feasible solutions for this problem myself. Why rebuild the wheel when someone already has a great solution with a tremendous amount of data?

This web service will return the iso country code based on lat/long.

Demian Brecht
  • 21,135
  • 5
  • 42
  • 46
  • +1 This looks quick and simple if all you are after is the country. – jsmith Mar 15 '11 at 18:03
  • Thank you, currently this is exactly what I am after. Will be looking into geocoding further as well mind so thanks @Ranhiru Cooray aswell. – Qwan Mar 16 '11 at 09:28
1

Another reverse geocoding service geonames.org

mateuscb
  • 10,150
  • 3
  • 52
  • 76