When I create a stream segmentation using Archydro,“Fdr” and “Str” are the inputs for the Flow Direction Grid and the Stream Grid respectively. The output is the Link Grid. How is defined considering both of Fdr and Str simultaneously?
Algorithms for performing stream network analysis all work in a similar way. These tools will use the D8 flow direction (Fdr) grid to navigate through a defined raster stream network (Str) using the network of flow paths defined by the D8 flow direction. Essentially what a link classification tool will do is scan the raster, usually starting from the upper-lefthand side and moving row-by-row down toward the lower-righthand side, finding each channel head grid cell. These channel heads are noticeable in the stream raster as stream cells with no upstream inflowing stream cells, i.e. they're the starting positions of the stream network. You can tell if a neighbouring grid cell is 'inflowing' based on the D8 flow direction grid. Basically, the algorithm will assign a unique identifier, starting with 1 and ending with the number of stream links encountered, in the order that they are first encountered. Thus, the ID itself is somewhat arbitrary and would change if the scan order of the algorithm changed. Once a channel head is located and an ID is assigned, the algorithm then traverses the flow path from that channel head cell using the flow direction data to figure out which grid cell to go to next. The traverse progresses downstream until it locates either a confluence in the stream network (i.e. a stream cell with more than one inflowing stream cell) or an outlet (i.e. a grid cell that has no downstream stream cell either because it has hit the edge of the raster or because it falls off the stream network in the streams raster). Each time it hits a confluence grid cell in the stream network, it assigns it the next unique ID value (incremented by one) and carries on until an outlet is found. Then the scan for channel heads continues until a new channel head cell is encountered. If during the traverse from a channel head, the algorithm finds a confluence that already has an ID value assigned to the output grid cell, the traverse stops (because it has already descended that part of the stream network from a previously encountered channel head). This link provides an example of source code for this type of algorithm.
It's true that the ID value itself is not necessarily meaningful; it's more like a nominal level variable. However, it is tremendously useful because it provides insight into the geometrical and topological structure of the stream network. It allows, for example, us to interrogate the stream network to assessing network topology using stream ordering techniques like the Horton/Strahler or Hack schemes, which themselves are surrogates for stream size (width, depths, discharge) and position. This can be useful for example in providing a basic means for modelling the ecology of streams simply based on an easily calculated index. The link ID also enables us to classify each link in a network as being interior or exterior (headwater streams), and the nodes (channel head, confluence, outlet). We can assess things like and link length and slope and analyze the relations of these geometric properties with their positions and stream numbers. This type of stream network analysis has played a significant role in the history of the field of fluvial geomorphology with notable early researchers including Horton, Strahler, Hack, Shreve and many others.
I hope that helps you to understand how the algorithm for link classification works, why it requires both a flow direction grid as well as the stream network raster, and why it serves as a useful (if not intermediate) step in stream network analysis.
While my answer does not directly answer your question using fdr and stream link, it may provide another approach to define the stream segment.
In my case, I would like to use accumulation instead of stream link grid. Remember that stream link grid is actually defined using the accumulation grid.
My algorithm is like this: locate the grid which has the largest accumulation, then follow the flow direction reversely, until you find the confluence, this segment is then defines using an unique ID such as 1. Starting from the confluence, we can keep similar search and assign IDs. In the end, we want the index to start from head water. So we just flip the ID using ID_new = total_segment - ID_current + 1.
Compared with original method, this method may not need to scan all the grid cells.