Skip to content
Prev 1729 / 29559 Next

Identifying overlapping polygons

I am still feeling my way around the "protocol" of this list serve, so I do
not want to clobber the archives with unneccessary communication.  However,
I am compelled to say thanks for the quick turn around and the extremely
helpful suggestions from Greg and Roger.  Thanks and I will let you know how
it ends up! 

-----Original Message-----
From: Greg Snow [mailto:Greg.Snow at intermountainmail.org] 
Sent: Friday, February 09, 2007 4:27 PM
To: Roger.Bivand at nhh.no; Andrew Niccolai
Cc: r-sig-geo at stat.math.ethz.ch
Subject: RE: [R-sig-Geo] Identifying overlapping polygons

Andrew,

Util the functionality is programmed in, here is a quick approximation to
what you want:

1. generate a large number of random (or gridded) points within the polygon
of interest in the first object (sample.polygon function in package sp).
2. use the overlay function in the sp package to find out which polygons in
object 2 the random points fall into.  You know these overlap. 

If there is a polygon in object 1 that only slightly overlaps a polygon in
object 2, then you are unlikely to detect that using this method, but your
statement about controlling the "Partial" indicates that this may be a good
thing.

Turning this around and generating the points from object 2 and seeing which
polygon in object 1 they are in will tell you if the polygon in object 2 is
completely overlapped by the one in 1.

Hope this helps,

--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at intermountainmail.org
(801) 408-8111