net.dist {stream.net}R Documentation

Calculate Distance Matrix for Stream Segments

Description

Compute the asymmetric distance matrix for stream segments. Upstream and downstream distances are included separately.

Usage

  net.dist (net, ends=0.5, method="coordinate", digits=10)

Arguments

net A net.object.
ends how to handle from and to segments if ends=0, do not use from and to lengths if ends=1, use total of from and to lengths if ends=0.5, use half of from and to lengths.
method method="coordinate" means network coordinate distance; method="segment" means distance in number of segments.
digits if digits=NULL, do not round output matrix, else precision of rounding.

Details

Upstream distances are found by indexing the source segment by its row and the destination segment by its column. Downstream distances are the opposite; the source is the column and the destination is the row.

Algorithm adapted from that of SG Leibowitz. This algorithm does produce roundoff residue and thus the matrix can be purged of very small non-zero values with rounding.

Value

A square matrix of dimension the number of segments.

Author(s)

Denis White, white.denis@epa.gov

See Also

net.object net.total.dist net.dir net.prox

Examples

  # Q model random net
  net <- net.qmodel (10)

  # add segments
  net <- net.addsegs (net)

  # distance matrix
  net.map (net, segatt=round (net$segs$length, 2))
  dmat <- net.dist (net, ends=0.5, method="coordinate")
  hist (dmat, col="gray", main="One Way Distances")

[Package stream.net version 1.0.6 Index]