How can I make a list of world geographic locations and their relative geographic hierarchies?

I want to create a database of geographic locations and would like to be able to identify locations that fall into other locations. For example, Empire State Building will have one geo-coordination, but my database will be able to tell me that it gets to Manhattan, which gets to New York, which is in the state of New York and so on.

I looked at OpenStreetMap , which seems to have a pretty decent database, but as far as I can tell, I will need to create a set of polygonal structures representing each region, and then determine if the coordinate falls into the given polygon of the region. Is there a better way to do this, or is there a data source where all this has already been calculated?

+7
source share
3 answers

You can also view the Geonames database. Although it is not classified using the hierarchical method, you could probably extract information from it.

If you really want to dive into creating a geographic database where you can analyze data, take a look at uploading your data to the free / open source PostgreSQL / PostGIS . With this, you can write SQL that answers questions such as "show me all the points [within the city / county / state border" or "[within the distance of X from Y location]".

Good places to learn more about PostGIS on the BostonGIS website, GIS.StackExchange , or, of course, a guide, but which reads more of them ...

+1
source

Try Yahoo! GeoPlanet data at http://developer.yahoo.com/geo/geoplanet/data/

It is already organized in a hierarchical structure, countries, administrative units and places.

You can also expand the data using the "Geo" YQL API methods at http://developer.yahoo.com/yql/console/

+3
source

I'm sure the Google Maps API has areas defined as polygons. And by the areas that I mean: state, city, zip code or anything that can be defined as a "region"

You would need to pass the test (Google Maps may have a function for this already) to see if it is inside the polygon.

You can also use the search address using the GeoLocation functions to find which regions the point is in and just use it.

0
source

All Articles