My problem is that I have a file with thousands of cities and I want to map city names to (Metropolitan Statistical Areas and the MSA equivalent for non-US cities. There have been a bunch of posts here on similar questions. I'm using Python if that helps (ie in case there is a python package available similar to how the googlemaps python package works...)
Mapping Cities to Zip Codes. There is a good answer here that provides a csv with zip codes for every city in the US. But because the census data is published mapping US counties to MSA's, instead of US cities, I would still need to find a way to map back from zip codes to US cities.
Database of US Cities to MSA This is essentially my question (at least the US portion), but it was not answered to the satisfaction of the poster, or my question.
Google's Geocoding Developer Site The Google Geocoding developer's site has a useful CSV that has some US cities mapped to a Google Metro Region code. The problem is that it is not MSA. The old Google csv, downloadable here does not say how the metro coding system was created. The site also has a link to the new Google coding system based on Nielsen's DMA (designated market area) coding system.
I'm really just looking for a csv file that has city, state (if US), country, region code. Where region code is based on well-regarded standard (the US Census Bureau's MSA would be ideal for US cities, and having non-US country's census classifications for non-US cities would be ideal too). Does such a file exist? Alternatively, is there a python package that connects to some database such that I run my script on my input file and it outputs the corresponding region code?
Thanks very much!
ANSWER
For anyone interested, here is a pretty good file that maps US cities to counties: http://www.census.gov/statab/ccdb/ccdbcityplace.html
In the United States, a metropolitan statistical area (MSA) is a geographical region with a relatively high population density at its core and close economic ties throughout the area.
Metropolitan Statistical Areas An MSA consists of one or more counties that contain a city of 50,000 or. more inhabitants, or contain a Census Bureau-defined urbanized area (UA) and have a total population of at least 100,000 (75,000 in New England).
The difference between MSAs and micropolitan statistical areas is size: a CBSA must have a population of at least 50,000 in its largest urban area to qualify as an MSA; CBSAs that fail to meet this criterion are micropolitan statistical areas.
An example of a typical metropolitan area is Chicago because it is a single large city and the surrounding areas are affected by their proximity to the large city. Another example is the Dallas-Ft Worth area.
I was on the hunt for a similar MSA-level resource and discovered this map at the CartoDB website: https://common-data.cartodb.com/tables/cb_2013_us_cbsa_5m/public/map
You can download several different formats, including GeoJSON and CSV. Here's a screenshot that shows the type and values of the data exported in CSV (since that was the original poster's requirement):
I hope this is helpful to others who come across this post!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With