w_intersect | R Documentation |
w_intersect handles the use case where we want to summarize areal features, such as land use, soils, etc, across reaches of a river, while taking into account drainage area, flow, etc.
w_intersect( riv, areas, area_id = NULL, drainage, pts, buff = 50, rid = "reach_id" )
riv |
An sf LINESTRING layer, the river channel |
areas |
Areal features to summarize; see 'details.' |
area_id |
Optional character vector giving field/column names that should be summarised; see 'details.' |
drainage |
Drainage direction raster for calculating catchment |
pts |
An |
buff |
Buffer width |
rid |
The column name in 'riv' containing reach ID numbers |
There are three output types:
riparian
: The layers in areas
are summarized within a riparian buffer around each reach
riparian_upstream
: The layers in areas
are summarized within a riparian buffer for each
focal reach and all upstream reaches
catchment
: The layers in areas
are summarized within the entire catchment for each reach
areas
must be in one of the following formats: terra::SpatRaster
, raster::raster
,
sp::SpatialPolygons
, or sf::sf
. Multiple features are allowed, in which case provide a
raster stack/multi band raster, or a list of polygon features.
If polygon features are specified in areas
, you must also specify which attributes should be
summarised in area_id
. Currently a single attribute per feature is supported, and it must
be specified by name, not column index. Partial matching with regular expressions is allowed, but
each item in area_id
must identify a single column in areas
. Ignored if areas
is a
raster.
A data.table summarising the polygons in each layer in areas along the river provided in x.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.