问题
I have a database of cities (in both the US and the rest of the world). The database entries are simple text strings. Currently the database contains even small cities (population 10,000). I wish to use a larger scale database instead, by assigning the cities into larger geographical\metropolitan areas. An example can be the Metropolitan areas in Google's AdWords API:
http://code.google.com/intl/iw-IL/apis/adwords/docs/developer/adwords_api_us_metros.html
but I have no problem using other databases instead.
I'd be grateful for any advice on how this can be performed using existing databases\APIs!
回答1:
You can use Yahoo's GeoPlanet database. You can easily find what's the parent of each place (WOEID - where on earth ID).
EDIT: You can also access this database using YQL.
来源:https://stackoverflow.com/questions/2708276/cities-to-metropolitan-areas