Determine census tract of US address
-
22-03-2021 - |
Question
I have a list of about 20k addresses in the US, and I would like to determine each one's census tract. I found a tool online that does this here, but making 20,000 requests and screenscraping the output seems like the wrong way to do.
One idea I had was to use some open source library like this to search the shapefiles provided here. However, it seems like someone should have written a utility to do something like
Geocoder.census_tract_of_address("200 N State Chicago IL 60601")
Does anyone know of such a thing? How best should I attack this problem?
Solution
You can geocode your address to get latitude and longitude from one of the many geocoding services out there (try Google, Yahoo, or OpenStreetMap).
Then you can look up the census tract using:
(Full disclosure: I run that site.)
It is a commercial solution where you can purchase access to the Web API, or purchase the Java Library to do your queries on your own system.
OTHER TIPS
Alternately, if you geocode your address you can use the Data.gov service to retrieve the census geography ID by coordinates: this will return the ID that is used by all the other Data.gov webservices.
Take a look at https://www.temboo.com/library/Library/DataGov/GetCensusIDByCoordinates/