topologies: Build topologies Build pixel and reach topologies for...

topologiesR Documentation

Build topologies Build pixel and reach topologies for delineated streams

Description

Build topologies Build pixel and reach topologies for delineated streams

Usage

pixel_topology(x, drainage, stream, id)

reach_topology(x, Tp)

Arguments

x

A raster::stack, such as one created by delineate(), or specify layers separately with drain and stream.

drainage

Optional, ignored if x is provided; a drainage direction raster

stream

Optional, ignored if x is provided; a delineated stream raster, all non-stream cells must be NA

id

Optional, ignored if x is provided; a raster of pixel ids, as, stream

Tp

Topology for pixels in the network, e.g., the output from pixel_topology().

Details

The topology is a square matrix showing immediate adjacency between pixels/reaches. Each row/column in the topology is a single pixel/reach. Zero entries indicate no adjacency between two nodes. A non-zero entry for row i column j indicates that i is upstream of j. The value in the entry is the reaction length of the upstream pixel/reach; this is the midpoint to midpoint distance from i to j. The actual length of each node is stored in the length attribute; thus Tp[i,j] == sum(attr(Tp, "length")[c(i,j)])/2

Value

A Matrix::sparseMatrix giving the pixel or reach topology

Examples


    data(kamp_dem)
    kamp = delineate(kamp_dem, outlet = NA)
    Tp = pixel_topology(kamp)
    Tr = reach_topology(kamp, Tp)



flee-group/watershed documentation built on July 25, 2022, 12:46 p.m.