ch_contours {CSHShydRology}R Documentation

Create Contours

Description

Creates contour lines from a DEM.

Usage

ch_contours(dem, zmin = NULL, zmax = NULL, n_levels = 10, z_levels = NULL)

Arguments

dem

Raster object of your dem in the desired projection (note: should have had sinks removed).

zmin

Minimum elevation value for contours. If not specified, minimum value dem is used.

zmax

Maximum elevation value for contours. If not specified, maximum value dem is used.

n_levels

Number of contour lines. Default is 10.

z_levels

Levels at which to plot contours. If specified, overrides zmin, zmax and n_levels.

Details

Generates contour lines from a DEM, which are returned as an sf object. The user can either provide a vector of elevation values by specifying the z_levels argument, or by supplying the minimum and maximum elevations (zmin and zmax) and the number of contour lines (n_levels).

Value

contours_sf

sf object containing contours

Author(s)

Dan Moore

Examples

# use volcano DEM
dem <- ch_volcano_raster()
# generate contours
contours <- ch_contours(dem)

# plot contours map
plot(contours)


[Package CSHShydRology version 1.4.2 Index]