Skip to content

miguel-porto/fix-streams

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

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")

About

R script to fix multiple confluences in river networks

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages