12

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

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

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

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

4

1 回答 1

2

我正在寻找类似的 MSA 级资源,并在 CartoDB 网站上发现了这张地图:https ://common-data.cartodb.com/tables/cb_2013_us_cbsa_5m/public/map

在此处输入图像描述

您可以下载多种不同的格式,包括 GeoJSON 和 CSV。这是一个屏幕截图,显示了以 CSV 格式导出的数据的类型和值(因为这是原始海报的要求):

在此处输入图像描述

我希望这对遇到这篇文章的其他人有所帮助!

于 2016-05-26T12:41:20.423 回答