Dear list: I am trying to calculate the intersection area between two irregular polygons (see example data below). set.seed(1234) theta <- seq(0, 2 * pi, length=(100)) poly1<- cbind(c(0 + 1 * cos(theta) + rnorm(100, sd=0.1)), c(0 + 2 * sin(theta))) poly2<- cbind(c(0 + 2 * cos(theta) ), c(-1 + 1.5 * sin(theta)+ rnorm(100, sd=0.1))) plot(x, y, type = "n", , xlim=c(-5,5), ylim=c(-5,5)) polygon(poly1) polygon(poly2) My data correspond to geographical positions, therefore I cannot generate it using equations as I did in the example. Are there any straightforward algorithm to calculate the intersection area between polygons poly1 and poly2? Thank you so much in advance Jonas [[alternative HTML version deleted]]
Dear Jonas, if you can write the difference in y-values between your polygons as a function, you can use integrate() to get the area between the polygons. It sounds like perhaps your x-values will not match between the polygons because they come from different sources, so you probably have to do some interpolating (with ?approx). hope that helps, Remko -- View this message in context: http://r.789695.n4.nabble.com/calculate-area-between-intersecting-polygons-tp3012980p3013059.html Sent from the R help mailing list archive at Nabble.com.
Seemingly Similar Threads
- Paste and namespace
- intersecting polygons and conversion from decimal degree to km
- Faster union of polygons?
- How do I ensure that the polygon in spatstat::owin(poly=<polygon>) does not have “negative area”
- SPATIAL QUESTION: HOW TO MAKE POLYGONS AROUND CLUSTERS OF POINTS AND EXTRACT AREAS AND COORDINATES OF THESE POLYGONS?