Learn R Programming

adehabitatMA (version 0.3.17)

getcontour: Computes the Contour Polygon of a Raster Object

Description

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.

Usage

getcontour(sp)

Value

Returns an object of class SpatialPolygons.

Arguments

sp

an object of class SpatialPixelsDataFrame

Warning

Holes in the polygons are not taken into account by the function.

Author

Clement Calenge clement.calenge@ofb.gouv.fr

See Also

SpatialPixelsDataFrame-class for additionnal information on objects of class SpatialPixelsDataFrame.

Examples

Run this code

data(meuse.grid)
a <- SpatialPixelsDataFrame(points = meuse.grid[c("x", "y")],
                            data = meuse.grid)


## the contour of the map
gc <- getcontour(a[,1])
plot(gc)



Run the code above in your browser using DataLab