Hi there, Is there any package which can calculate the overlapping area of two polygons or output the coordinates of the overlapping of two polygons? Thanks. Haiyong
Are your polygons convex? --- Haiyong Xu <xuhy at ucla.edu> wrote:> Hi there, > Is there any package which can calculate the > overlapping area of two > polygons or output the coordinates of the > overlapping of two polygons? > > Thanks. > Haiyong > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, > reproducible code. >
No. On Oct 16, 2007, at 11:32 PM, Moshe Olshansky wrote:> Are your polygons convex? > > --- Haiyong Xu <xuhy at ucla.edu> wrote: > >> Hi there, >> Is there any package which can calculate the >> overlapping area of two >> polygons or output the coordinates of the >> overlapping of two polygons? >> >> Thanks. >> Haiyong >> >> ______________________________________________ >> R-help at r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide >> http://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, >> reproducible code. >> >
On 17/10/2007 2:23 AM, Haiyong Xu wrote:> Hi there, > Is there any package which can calculate the overlapping area of two > polygons or output the coordinates of the overlapping of two polygons?I believe gpclib can do both of those. Duncan Murdoch
Haiyong Xu <xuhy at ucla.edu> writes:> Is there any package which can calculate the overlapping area of two > polygons or output the coordinates of the overlapping of two polygons?The function overlap.xypolygon(A,B) in package 'spatstat' calculates the area of overlap between two polygons A and B (not necessarily convex). The format for A and B is list(x,y) where x and y are coordinate vectors of the polygo vertices, traversed in anticlockwise order. Adrian Baddeley