rasterToContour.Rd
RasterLayer to contour lines. This is a wrapper around contourLines
rasterToContour(x, maxpixels=100000, ...)
a RasterLayer object
Maximum number of raster cells to use; this function fails when too many cells are used
Any argument that can be passed to contourLines
Most of the code was taken from maptools::ContourLines2SLDF, by Roger Bivand & Edzer Pebesma
SpatialLinesDataFrame
f <- system.file("external/test.grd", package="raster")
r <- raster(f)
x <- rasterToContour(r)
class(x)
#> [1] "SpatialLinesDataFrame"
#> attr(,"package")
#> [1] "sp"
plot(r)
plot(x, add=TRUE)