rewiringamerica / api.rewiringamerica.org

A RESTful web API for federal, state, utility and local rebates, tax credits and other electrification incentives.
https://api.rewiringamerica.org
Apache License 2.0
7 stars 0 forks source link

Identify counties by FIPS code, not by name #451

Closed oyamauchi closed 5 months ago

oyamauchi commented 5 months ago

Description

Our zips data identifies counties just by their name, e.g. Suffolk. Geocodio identifies them like Suffolk County. This would cause problems for county-level incentives, which need the location's county to match the county name in authorities.json.

It's not trivial to adapt one format into the other (the second word isn't always "County"; you can't just chop off the last word of the Geocodio value; etc.) so instead, let's identify counties using a consistent non-human-friendly identifier.

One other little advantage of the FIPS code is that the first five digits of a tract ID are the county's FIPS code. We're not making use of this fact yet, but it may come in handy.

Two concurrent minor changes:

I used this document to manually convert existing county names (it doesn't have territories, but I just got those from the tract IDs): https://transition.fcc.gov/oet/info/maps/census/fips/fips.txt

Test Plan

yarn test