[R-sig-Geo] Identifying overlapping polygons

Roger Bivand Roger.Bivand at nhh.no
Fri Feb 9 20:56:08 CET 2007


On Fri, 9 Feb 2007, Andrew Niccolai wrote:

> Hi.  I am relatively new to Spatial-R.  I have two objects that are both
> SpatialPolygonsDataFrame classes.  One is comprised of polygons from a
> section of a segmented image and the other is essentially circular polygons
> representing the potential areas that the crowns of known tree locations
> might cover.  I would like to identify every polygon from the first object
> (image segmentation polys) that completely are even partially (hopefully I
> can control the "partial" threshold) falls within any given polygon from the
> second object (crown areas).  In ArcGIS this can be accomplished using the
> Identity application under ArcToolbox.  I was hoping to accomplish the same
> feats in R.  Any help would be greatly appreciated!!

This is not present yet, but not impossible. If you look in the code of 
the unionSpatialPolygons() function in the maptools package, you will see 
that it uses functions in the gpclib package. Using similar ideas to 
examine either all n by m intersections, or a clever subset by looking at 
bounding box intersections first, it ought to be feasible. You'll need to 
be prepared to code it, though.

Roger

> 
> Andrew Niccolai
> Doctoral Candidate
> Yale School of Forestry
> 
> _______________________________________________
> 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