hf_survey: Accumulated travel time

View source: R/hf_survey.R

hf_surveyR Documentation

Accumulated travel time

Description

Survey entire landscape to calculate accumulated cost of travel from one or more start points.

Usage

hf_survey(x, from)

Arguments

x

a cost terrain generated by hf_terrain().

from

an sf specifying start locations, must be POINT or MULTIPOINT.

Value

a SpatRaster with accumulated travel costs from each start point.

Examples

library(sf)
library(terra)

fn <- system.file("extdata/red_butte_dem.tif", package = "hiker")
red_butte_dem <- rast(fn)

from <- st_sf(geometry = st_sfc(st_point(c(432000, 4514000)),
                                st_point(c(434000, 4518000)),
                                crs = 26912))

terrain <- hf_terrain(red_butte_dem)

cost_surface <- hf_survey(terrain, from)

plot(cost_surface)
plot(st_geometry(from), pch = 19, col = "red2", add = TRUE)


kbvernon/hiker documentation built on Dec. 9, 2022, 11:16 p.m.