nh_linefill | R Documentation |
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.
nh_linefill(spf, field, max.dist = NA, max.line = NA)
spf |
input spatial features (model predictions; sp or sf spatial object) |
field |
name of field in |
max.dist |
maximum distance between selected lines to fill in |
max.line |
maximum number of lines between selected lines to fill in |
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.
sf object including suitable lines and filled-in lines
David Bucklin
## Not run:
spf <- st_read("SDM_results.shp")
fill <- nh_linefill(spf, "thresh", max.dist = 5000, max.line = 5)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.