gSymdifference {rgeos} | R Documentation |
Function for determining the symmetric difference between the two given geometries
gSymdifference(spgeom1, spgeom2, byid=FALSE, id=NULL)
spgeom1, spgeom2 |
sp objects as defined in package sp |
byid |
Logical vector determining if the function should be applied across ids (TRUE) or the entire object (FALSE) for spgeom1 and spgeom2 |
id |
Character vector defining id labels for the resulting geometries, if unspecified returned geometries will be labeled based on their parent geometries' labels. |
Returns the regions of spgeom1 and spgeom2 that do not intersect. If the geometries do not intersect then spgeom1 and spgeom2 will be returned as separate subgeometries.
Roger Bivand & Colin Rundel
gDifference
gIntersection
gUnion
x = readWKT("POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0))") y = readWKT("POLYGON ((5 5, 15 5, 15 15, 5 15, 5 5))") d = gSymdifference(x,y) plot(d,col='red',pbg='white')