Geocoder functions using Allgheny County's GIS Esri API for use in Python and R. Note that the address column should be as complete as possible ie: 436 Grant Street, PA, 15219
but should not include Apartment/Unit names/numbers or mailing city address. Instead the traditional "City" locaiton should be the municiaplity. Geocoded addresses are the highest scored coordinates.
Warning: For geocodes in the tens of thousands users are asked to wait until non-business hours to avoid crashing the server.
The usps_geocde.R
functions the same way as the County script, but uses the United States Postal Service Geocoder.
R: source('https://raw.githubusercontent.com/Allegheny-CountyStats/ALCO-Geocoder/master/alco_geocoder.R')
Python 2 (untested): execfile("https://raw.githubusercontent.com/Allegheny-CountyStats/ALCO-Geocoder/master/County.py")
Python 3: exec(open('https://raw.githubusercontent.com/Allegheny-CountyStats/ALCO-Geocoder/master/County.py').read())
R:
geo_data <- data %>%
mutate_countyGeo(Full_Address_Column)
Python:
# Single Address
county_geocode('436 Grant Street, Pittsburgh PA 15219')
# Pandas
county_geo_pd(df, col = 'Full_Address_Col'):