Message-ID: <971536df0705061810o35a8879fu515990f79fc9fe42@mail.gmail.com>
Date: 2007-05-07T01:10:18Z
From: Gabor Grothendieck
Subject: geocoding street addresses
In-Reply-To: <20070507003050.0C3F07CF@annwn14.rutgers.edu>
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.