[CITAMS] Map US towns to FIPS?

Nathaniel Poor natpoor at gmail.com
Thu Mar 16 14:49:12 EDT 2017

Hi everyone,

Does anyone have a method for mapping all of the towns and cities in the US to a correct *and single* county FIPS code?

We’re looking at some cultural production data, and have one big CSV file with town/city and state, and have another CSV file with economic measures on the county level. We also have a file which does indeed map towns and cities to their county, but the problem is a lot of towns and cities overlap county lines, and so my matching program gives those two or three FIPS codes. (I’m using Python and Mongo.) (And yes, “New York City” gets five FIPS, if you’re counting.)

We’ve done this on a subset in some prior research and I had to manually determine which county was more appropriate, which took a while but wasn’t too hard once I found the right information (usually Wikipedia but sometimes also Google Maps). But, with data from the entire US (well 50 state plus DC), there are too many to reasonably tackle without a small to medium cadre of RAs which we don’t have. Someone might have had this issue previously!

I’ve Googled around a bit, and haven’t found the right thing yet. I did find a big CSV file (tabbed, actually) from Code for America in GitHub, and it had a header for FIPS but didn’t have it. It did have a location FIPS for each city/town, which I’m not too familiar with but it looked like that could help if I had another file that mapped location FIPS to single county FIPS in an accurate manner. (Yes, there are probably times when mapping to just one county is not going to be the most accurate approach, depending on your analysis, but from our previous work I think I maybe encountered one of these at most.)

Any help is appreciated. (Random assignment really isn’t appropriate for this analysis.)


Nathaniel Poor, Ph.D.

More information about the CITAMS mailing list