[R-sig-Geo] geocoding street addresses

Gabor Grothendieck ggrothendieck at gmail.com
Mon May 7 03:10:18 CEST 2007


On 5/6/07, Markus Loecher <loecher at eden.rutgers.edu> wrote:

> is there an R package which would let me geocode street addresses
> into lat/lon pairs ? I have searched quite a bit but it seems as if
> the ESRI software is my only way to go ?

Non-commercial terms of use or commercial with payment but if that's
ok then for US addresses:

URL <- "http://rpc.geocoder.us/service/csv?address"
addr <- "1600 Pennsylvania  Ave, Washington DC"
addr <- gsub(" ", "+", addr)
addr <- gsub(",", "%2C", addr)
tmp <- tempfile()
download.file(paste(URL, addr, sep = "="), destfile = tmp)
cn <- c("Lat", "Long", "Addr", "City", "State", "zip")
read.table(tmp, sep = ",", col.names = cn)

See web indicated web site for more info.




More information about the R-sig-Geo mailing list