Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I build a list of world geo locations and their relative geographical hierarchies?

I want to build a database of geographical locations and would like to be able to identify locations that fall inside other locations. For example, The Empire State Building is going to have one geo-coordinate, but my database would be able to tell me that it falls inside Manhattan, which falls inside New York City, which is in the state of New York and so forth.

I've been looking at OpenStreetMap which seems to have a pretty decent database but as best I can tell, I would need to create a set of polygon structures representing each region and then detect if a coordinate falls inside a given region's polygon. Is there a better way to do this, or is there a data source where all of this has already been calculated?

like image 507
Nathan Ridley Avatar asked Jul 25 '11 18:07

Nathan Ridley


People also ask

What is geo hierarchy?

The Geography hierarchy contains attributes such as Country and Region, as well as Distribution Center, Call Center, and employee-specific attributes.


2 Answers

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

It is already organised into a hierarchy structure, countries, admin divisions and places.

You can also extend the data by using the 'Geo' methods of the YQL API at http://developer.yahoo.com/yql/console/

like image 58
Chaoley Avatar answered Oct 13 '22 10:10

Chaoley


You also may want to look into the Geonames database. While it is not classified using hierarchical method, you could probably derive the information out of it.

If you really want to dive into building a geographical database where you can analyze the data, take a look at loading your data into the free/open-source PostgreSQL/PostGIS stack. With that you can actually write SQL that answers questions like "show me all points [within a city/county/state boundary]" or "[within X distance from Y location]".

Good places to learn more about PostGIS is at the BostonGIS website, the GIS.StackExchange pages, or of course the manual but who reads those anymore...

like image 25
RyanKDalton Avatar answered Oct 13 '22 12:10

RyanKDalton