Skip to content
Prev 23221 / 29559 Next

Union/Overlay single spatialPolygonsDataFrame containing overlapping polygonsto create polygons with all unique combinations of attributes

On Mon, 10 Aug 2015 at 17:52 nevil amos <nevil.amos at gmail.com> wrote:

            
Is raster::cover closer to what you want?

library(raster)

plot(mySPDF2)
 plot(cover(mySPDF2[1,], mySPDF2[,2]), add = TRUE, col = rgb(c(0, 1), c(0,
0), c(1, 0), c(0.5)))
 plot(mySPDF2)
 plot(cover(mySPDF2[2,], mySPDF2[1,]), add = TRUE, col = rgb(c(0, 0), c(0,
1), c(1, 0), c(0.5)))

You'll still need to take the non-overlapping piece from the complement
overlay. I don't know if there's an easier way.
See ?"raster-package" for a complete overview.

HTH, Mike.


many thanks in advance