[R-sig-Geo] geocoding street addresses

Roger Bivand Roger.Bivand at nhh.no
Mon May 7 08:52:39 CEST 2007


On Sun, 6 May 2007, Gabor Grothendieck wrote:

> 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.

This approach is also documented in Hack 80, pp. 403-408, in Erle, Gibson
and Walsh (2005) Mapping Hacks, O'Reilly. The hack shows how to ask for
multiple points, and how to (try to) disambiguate multiple replies to a
single query. Sadly, geocoding outside the US is far more difficult.

Roger

> 
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no




More information about the R-sig-Geo mailing list