Link to home
Start Free TrialLog in
Avatar of zstapic
zstapicFlag for Croatia

asked on

Determine Country by Geographic Coordinate

Hi, is it possible to determine country name by having only geographic coordinate in SQL Server 2008?
Avatar of wht1986
wht1986
Flag of United States of America image

if you had a table containing the geography of each country it is quite easy
ASKER CERTIFIED SOLUTION
Avatar of wht1986
wht1986
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of oobayly
The NOAA provides coastline data, unfortunately it's just a series of points. While it's simple to create a geography object from them, it doesn't provide the name of the country.

http://rimmer.ngdc.noaa.gov/coast/

Also have a look here:
http://www.collinssoftware.com/freegis_by_region.htm
did that help zstapic?
I also have a basic set of data that contains the bounding rectangle for countries, you could either test for a point being inside the rectangle, or a point closest to the rectangle's centroid.
However it's not guaranteed as if you take a point just inside the border of a large country, the centroid of the neighbouring small country may be closer, so the wrong country could be returned.