getcontour computes the contour polygon of a raster object of class SpatialPixelsDataFrame. When the object is made of several parts, the function returns one polygon per part.
getcontour(sp)
Arguments
sp: an object of class SpatialPixelsDataFrame
Returns
Returns an object of class SpatialPolygons.
Warning
Holes in the polygons are not taken into account by the function.
SpatialPixelsDataFrame-class for additionnal information on objects of class SpatialPixelsDataFrame.
Examples
data(meuse.grid)a <- SpatialPixelsDataFrame(points = meuse.grid[c("x","y")], data = meuse.grid)## the contour of the mapgc <- getcontour(a[,1])plot(gc)