[R-sig-Geo] Receiving ID of polygons when intersecting SpatialPolygons(DataFrame) and SpatialPoints

Edzer Pebesma edzer.pebesma at uni-muenster.de
Thu Oct 8 22:14:01 CEST 2015



On 08/10/15 03:14, Vv wrote:
> Hi list,
>  
> I am currently tackling with the sp function over.
>  
> I intersect a SpatialPoints object with a SpatialPolygonsDataFrame.
> I'd like to know how I can receive the ID of the polygons within the
> Polygons slot of the SpatialPolygonsDataFrame which are intersecting the
> SpatialPoints?
>  
> Overlap<-sp::over(spPoints, spPolyDataFrame, returnList=TRUE)
>  
> Whenever I use over I just receive "1" as result.
>  
> Or is there a way to intersect SpatialPoints with objects of class
> polygons that I miss?

rgeos::gIntersects : with arguments byid=TRUE and returnDense=FALSE it
should return a similar list.

>  
> Best,
> Ena
> 
> 
> _______________________________________________
> 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/20151008/92389f45/attachment.bin>


More information about the R-sig-Geo mailing list