Skip to content
Prev 23226 / 29559 Next

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

Nevil,

raster::union does not _require_ two SpatialPolygons*, it also works
with one. See ?raster::union,  this is the (valid) case where 'y' is
missing.
ID.1 ID.2 ID.3 ID.4 count
1    1    0    0    0     1
2    0    1    1    0     2
3    0    0    0    1     1
class       : SpatialPolygonsDataFrame
features    : 3
extent      : 1, 5, 1, 5  (xmin, xmax, ymin, ymax)
coord. ref. : NA
variables   : 5
names       : ID.1, ID.2, ID.3, ID.4, count
min values  :    0,    0,    0,    0,     1
max values  :    1,    1,    1,    1,     2
Robert
On Tue, Aug 11, 2015 at 8:14 PM, nevil amos <nevil.amos at gmail.com> wrote: