R/river_outlets.R
river_outlets.Rd
The function identifies the coordinates of raster cells which are just upstream from river confluence points identified from a river network layer. The cell just upstream from confluence allows delineation of segment specific catchments.
river_outlets(river, drain.dir)
river | An 'sf' linestring feature representing a river network. |
---|---|
drain.dir | A RasterLayer object of drainage directions. |
Returns an 'sf' point object of identified raster cell centers.
Includes all the attributes in the given river
object.
The function logic is such that it looks at the last node-pair of each segment in the river network. The angle of the last node pair is computed, and the raster cell from where the last node-pair originated is identified. Note that the logic of the function requires that the river network is derived from the same raster than the drainage directions input to the function.
Note: Drainage directions must be coded in 1-128 as follows:
1:East
2:Southeast
4:South
8:Southwest
16:West
32:Northwest
64:North
128:Northeast