[R-sig-Geo] Habitat on a given location (spatial join with R)
Michael Sumner
mdsumner at gmail.com
Fri Jan 7 12:01:07 CET 2011
library(sp)
?overlay
The example there overlay(srdf, meuse) does what you want for two
variables "X1" and "X2" copied from SpatialPolygonsDataFrame srdf to
the coordinates of SpatialPointsDataFrame meuse.
Also try the sp vignette for an introduction to the Spatial types:
vignette("sp")
I used rgdal's readOGR for shapefiles, but there are other read
functions for shapefiles in maptools, which may be more convenient.
Cheers, Mike.
On Fri, Jan 7, 2011 at 9:37 PM, Breitbach, Nils <breitbach at uni-mainz.de> wrote:
> Derar community,
>
> this time I need to find habitat type on given location for a huge number of points. I have two layers: the first (upper) one is a point shape with approx. 100,000 point locations; the second one is a polygon shape with many features containing habitat types (on a very fine scale). Now, I need the habitat type "under" every point or better said for every point location.
>
> The "Spatial Join" Tool in ESRI's ArcGIS would do exactly what I need but since I did all my analyses with R so far I really would like to avoid the permanent jumping between R and ArcGIS. Is there a function in R that solves my problem?
>
> Cheers,
>
> Nils
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
--
Michael Sumner
Institute for Marine and Antarctic Studies, University of Tasmania
Hobart, Australia
e-mail: mdsumner at gmail.com
More information about the R-sig-Geo
mailing list