[R] calculate area between intersecting polygons

Remko Duursma remkoduursma at gmail.com
Tue Oct 26 14:15:06 CEST 2010


Here is a different solution:

library(gpclib)
p1 <- as(poly1, "gpc.poly")
p2 <- as(poly2, "gpc.poly")

area.poly(p2) + area.poly(p1) - area.poly(union(p1,p2))


I.e., take areas of both polygons and subtract the union (check
plot(union(p1,p2)) ) to get the area of the intersection.


greetings,
Remko
-- 
View this message in context: http://r.789695.n4.nabble.com/calculate-area-between-intersecting-polygons-tp3012980p3013588.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list