|river system of Tyrol|
|glacier river Isel in the Eastern district of Tyrol|
In this post following open software tools are used: GRASS GIS and R. In the last days I've uploaded a new GRASS GIS addon: v.fixed.segmentpoints.
This little addon creates segment points along a vector line with fixed distances.
|segment points along a vector line with fixed distances (e.g. every 10m a point along a river)|
But how can this addon now be useful related to streams? One of the individual characteristics of a single stream is the long profile. The long profile shows how a river’s gradient changes as it flows from its source to its mouth/outlet.
Let's do a few simple steps in GRASS GIS:
Then start a R session:# set every 10m a point along the vector line of the river isel (open data)v.fixed.segmentpoints vector=riverisel cat=1 dir=C:\tmp\ distance=10
# given a 10m x 10m DEM,(open data), v.what.rast - uploads raster values at positions of vector points to the table.
v.what.rast map=segmentpoints raster=dem column=elevation
# db.out.ogr - exports attribute tables into a CSV file as input for a R session
db.out.ogr input=segmentpoints dsn=C:\tmp\rinput.csv
# import GRASS exported data into RThanks to 2 open data sets, 2 open source software and a few command line statements a river long profile can be compiled:
riverdata <- read.csv("rinput.csv", header = TRUE, sep = ",", dec = ".")
# quick look at the statistics
Min. : 0 Min. : 665.3
1st Qu.:14715 1st Qu.: 742.7
Median :29430 Median : 933.6
Mean :29430 Mean :1098.0
3rd Qu.:44145 3rd Qu.:1289.3
Max. :58858 Max. :2411.5
# make data coloumns available for calculation
# plot the river long profile
plot(distance,elevation, type = "l", col = "blue", \
main = "river long profile: glacier river Isel", \
xlab = "distance from source (m)", ylab = "elevation (m a.s.l.)")
|river long profile: Isel|