Skip to content

Latest commit

 

History

History
8 lines (8 loc) · 1.02 KB

README.md

File metadata and controls

8 lines (8 loc) · 1.02 KB

fix-streams

R script to fix multiple confluences in river networks

This script corrects all nodes in a river network which have more than 2 streams flowing to them. The outermost streams' end vertices are adjusted by step meters along the downgoing stream. New nodes are created at suitable places, and existing lines suitably split. This is useful for correcting river networks before using network analysis tools which don't allow complex confluences, such as STARS

Requires a line shapefile with the proper FROM_NODE and TO_NODE fields. The file is assumed to be correct in all other aspects, there is no error checking, so carefully check the result.

Usage example

streams=readOGR("streams_Pt.shp","streams_Pt")
correctedshp=fix.streams(streams,step=10)
writeOGR(correctedshp,"streams_corrected.shp","streams_corrected","ESRI Shapefile")