Browser application for looking up CBSA and RUCA codes
Maps ZIP-5 codes to CBSA codes. This mapping was obtained from the 2007 ZIP code to 2006 CBSA mapping published by the census.
There is good documentation available on that site. Note that we use a subset of the spreadsheet published there; the iPython Notebook Make-CBSA-Spreadsheet.ipynb was used for the conversion.
Maps FIPS 11-digit codes to RUCA secondary codes. The mapping was obtained from the 2010 Rural Urban Commuter Area Codes
mapping published by the USDA.
The dataset downloadable there contains more helpful information. Again we use just a subset of that dataset; the iPython
Notebook Make-RUCA-Spreadsheet.ipynb was used for the conversion. Note that it reads in a .csv, not a .xlsx as available
on the website. Parsing the Excel File with Pandas leads to problems, so I recommend saving a copy of the Excel File as a .csv and then working with that.
Note that there are different types of FIPS-codes, e.g. 15-digit vs. 11-digit. The only difference is that the final four digits of the 15-digit code are block group and block numbers. So we can query the FCC's API for 15-digit FIPS codes and simply truncate the final four. See here for another short introduction to FIPS codes.
The FIPS -> RUCA mappings are definitely correct. The Address -> FIPS mappings are subject to greater error. If in doubt, use the mapping tool provided by the government here to double-check your results.
The index.html and functions.js are deployed externally, not to Heroku. We query the Heroku server via AJAX in getcbsa.js. Note that this function has url: localhost:5000.
This is for testing purposes. If you deploy this, you'll want to swap the url parameter out for the url of your heroku instance.
You can access the tool at johnloeber.com/geolookup.