get_rem: Get Transects

Description Usage Arguments Value Note Examples

View source: R/rem.R

Description

Get Transects

Usage

1
get_rem(linestring, raster, distance, length)

Arguments

linestring

A data.frame of sf_LINESTRING

raster

A raster (digital elevation model (DEM))

distance

A numeric indicating distance between transects

length

A numeric indicating the length of the transect

Value

A sf_POINT data.frame with elevations along transects (elevation_adj) and trend line (elevation_main).

Note

Be aware of your crs projection as this will affect the length and distance arguments.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
pts = matrix(c(170800,172000, 5410500, 5410400), 2)
line = sf::st_as_sf(sf::st_sfc(sf::st_linestring(pts), crs = 32612))

ele <- elevatr::get_elev_raster(line,
                                z = 13,
                                prj = '+proj=utm +zone=12 +datum=WGS84 +units=m +no_defs')

rem <- get_rem(line, ele, distance = 100, length = 500)

ele_crop <- terra::crop(terra::rast(ele), terra::vect(sf::st_buffer(line, 200)))
terra::plot(ele_crop)
plot(rem$geometry)

## End(Not run)

joshualerickson/remr documentation built on Feb. 13, 2022, 4:08 a.m.