US Census Geocoder
Overview
The US Census Geocoder leverages the US Census Geocoding service for single record and batch geocoding. The
service enforces no limits and is free to US. More information can be found at the US Census
website. For multiple records, it is recommended that you use the CensusGeocoder.geocode_address_batch()
method.
API
- class parsons.CensusGeocoder(benchmark='Public_AR_Current', vintage='Current_Current')[source]
Instantiate the CensusGecoder Class
- Args:
- geocode_onelineaddress(address, return_type='geographies')[source]
Geocode a single line address. Does not require parsing of city and zipcode field. Returns geocode as well as other census block data. If the service is unable to geocode the address it will return an empty list.
- Args:
- address: str
A valid US address
- return_type: str
geographies
will return information about the Census geographies whilelocations
will information about the address.
- Returns:
dict
- geocode_address(address_line, city=None, state=None, zipcode=None, return_type='geographies')[source]
Geocode an address by specifying address fields. Returns the geocode as well as other census block data.
- Args:
- address_line: str
A valid address line
- city: str
A valid city
- state: str
A valid two character state abbreviation (e.g. ‘IL’)
- zipcode: int
A valid five digit zipcode (e.g. 60622)
- return_type: str
geographies
will return information about the Census geographies whilelocations
will information about the address.
- Returns:
dict