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

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


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/


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...


I'm pretty sure the google maps API has regions defined as polygons. And by regions I means, State, City, Zip Code, or just about anything that could be defined as a "region"

You would have to hit-test (Google Maps might have a function for this already) a point to see if it is inside a polygon.

You could also use the lookup address by GeoLocation functions to find which region(s) a point resides in, and just use that.