openSTARS (version 1.0.0)

calcCatchmArea_assignNetID: Calculate total catchment area of a stream segment and assign a network id.

Description

Recursive function to calculate the upstream area of each stream segment and assign a unique network id. It is called by calc_edges for each outlet and should not be called by the user.

Usage

calcCatchmArea_assignNetID(dt, id, net_ID)

Arguments

dt

data.table containing the attributes of the stream segments

id

integer; 'stream' of the stream segment

netID

integer; network ID

Value

Total catchment area upstream of the segment

Details

calcCatchmArea_assignNetID

Examples

Run this code
# NOT RUN {
 outlets <- dt.streams[next_str == -1, stream]
 netID <- 1
 for(i in outlets){
   calcCatchmArea_assignNetID(dt.streams, id = i, netID)
   netID <- netID + 1
 }
# }

Run the code above in your browser using DataLab