[R-sig-Geo] how to determine which administrative area a point belong to

Edzer Pebesma edzer.pebesma at uni-muenster.de
Thu Jun 18 17:13:03 CEST 2015



On 06/18/2015 04:57 PM, Victor Kuperman wrote:
> I have a large number of data points with longitude and latitude coordinates
> (e.g. 57.118, -2.167). I am interested in knowing which administrative areas
> in the UK these points fall into. I have downloaded administrative areas for
> the UK:
> 
> adm <- getData('GADM', country='GBR', level=2)
> 

pts = spsample(adm, 100, "random") # samples 100 points from adm

plot(adm)
points(pts, col = 'red')

over(pts, adm)

>  
> 
> Now I cannot identify an R function that would associate a data point with
> an administrative area. 
> 
> Help will be greatly appreciated.
> 
>  
> 
>  
> 
> Victor Kuperman, Ph.D.
> 
> Assistant Professor, Linguistics and Languages
> 
> McMaster University
> 
> Togo Salmon Hall 626
> 
> 1280 Main Street West
> 
> Hamilton, Ontario, Canada L8S 4M2
> 
> phone: 905-525-9140, x. 20384
> 
> vickup at mcmaster.ca
> 
> www.humanities.mcmaster.ca/~vickup
> 
>  
> 
>  
> 
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> 

-- 
Edzer Pebesma
Institute for Geoinformatics (ifgi),  University of Münster,
Heisenbergstraße 2, 48149 Münster, Germany; +49 251 83 33081
Journal of Statistical Software:   http://www.jstatsoft.org/
Computers & Geosciences:   http://elsevier.com/locate/cageo/
Spatial Statistics Society http://www.spatialstatistics.info

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: OpenPGP digital signature
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20150618/d0ce50b3/attachment.bin>


More information about the R-sig-Geo mailing list