powered by
Symetrical difference of SpatialPolygons* objects
# S4 method for SpatialPolygons,SpatialPolygons symdif(x, y, ...)
SpatialPolygons*
SpatialPolygons* object
Additional SpatialPolygons* object(s)
erase
#SpatialPolygons p <- shapefile(system.file("external/lux.shp", package="raster")) b <- as(extent(6, 6.4, 49.75, 50), 'SpatialPolygons') crs(b) <- crs(p) sd <- symdif(p, b) plot(sd, col='red')
Run the code above in your browser using DataLab