nh_linefill: For line-based SDM predictions, identify areas between...

View source: R/nh_linefill.R

nh_linefillR Documentation

For line-based SDM predictions, identify areas between predicted suitable lines

Description

Provided a network of lines (e.g., reaches in a hydrological network), and an attribute that identifies those lines representing suitable habitat, this function identifies fill-in lines between suitable lines, given certain limits (total distance and/or total reaches). It does not alter original line segments.

Usage

nh_linefill(spf, field, max.dist = NA, max.line = NA)

Arguments

spf

input spatial features (model predictions; sp or sf spatial object)

field

name of field in spf (binary 1/0), where lines will be filled between features with value == 1

max.dist

maximum distance between selected lines to fill in

max.line

maximum number of lines between selected lines to fill in

Details

Line directionality is used to identify how they are connected in the network, so start/end nodes must align. These nodes will be calculated; alternatively, the names startNode and endNode can be provided as columns in spf and will be used instead.

Values for max.dist should be in the units of the CRS, except when using a lat/lon based CRS, in which case the value should be in meters.

Value

sf object including suitable lines and filled-in lines

Author(s)

David Bucklin

Examples

## Not run: 
spf <- st_read("SDM_results.shp")
fill <- nh_linefill(spf, "thresh", max.dist = 5000, max.line = 5)

## End(Not run)

VANatHeritage/nhSDM documentation built on Feb. 1, 2024, 6:39 a.m.