topologies | R Documentation |
Build topologies Build pixel and reach topologies for delineated streams
pixel_topology(x, drainage, stream, id) reach_topology(x, Tp)
x |
A raster::stack, such as one created by |
drainage |
Optional, ignored if |
stream |
Optional, ignored if |
id |
Optional, ignored if |
Tp |
Topology for pixels in the network, e.g., the output from |
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
A Matrix::sparseMatrix giving the pixel or reach topology
data(kamp_dem) kamp = delineate(kamp_dem, outlet = NA) Tp = pixel_topology(kamp) Tr = reach_topology(kamp, Tp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.