AllDownstreamSubids returns a vector of downstream SUBIDs to the outlet if no BranchData is provided, otherwise a data frame with
two columns downstream with downstream SUBIDs and is.branch with logical values indicating if a downstream SUBID contains a
bifurcation ('branch' in HYPE terms). Downstream SUBIDs are ordered from source to final outlet SUBID.
Arguments
subid
Integer, SUBID of a target sub-catchment (must exist in gd).
gd
Dataframe, an imported 'GeoData.txt' file. Mandatory argument. See 'Details'.
bd
Dataframe, an imported 'BranchData.txt' file. Optional argument. See 'Details'.
write.arcgis
Logical. If TRUE, a string containing an SQL expression suitable for ArcGIS's
'Select By Attributes' feature will be written to the clipboard.
Details
AllDownstreamSubids finds all downstream SUBIDs of a given SUBID along the main stem (including itself but not
including potential irrigation links or groundwater flows) using GeoData columns 'SUBID' and 'MAINDOWN'. If a BranchData file
is provided, the function will also include information on downstream bifurcations.