Add a points per cross section column to an sf dataframe of linestrings given a DEM and min points value
add_points_per_cs.Rd
This function calculates and adds a column called 'points_per_cs' to an sf dataframe representing cross-sections (linestrings) based on a provided DEM and a minimum points value per cross section.
Arguments
- cs
An sf dataframe representing cross-sections (linestrings). With a required cs_lengthm column (length of cross section in meters)
- points_per_cs
numeric, number of points per cross section. Default is NULL
- min_pts_per_cs
An optional minimum points value per cross section. If not provided,
- dem
A SpatRaster object representing the Digital Elevation Model (DEM) or a character string referencing a remote resource. the function calculates it based on the length of cross-sections and the resolution of the DEM.