DTW alignment of original & final channel centerlines is performed using Euclidean distance matrix for corresponding spline points augmented with the third dimension of curvature at those points. That is for each point q of original centerline and point p of final centerline, the matrix of following distances is computed.
\[ d(q,p)=\sqrt{(x_q-x_p)^2 + (y_q-y_p)^2 + \lambda^2(c_q-c_p)^2} \]
, where λ is a Curvature multiplier parameter.
Since curvature varies a little compared to spatial coordinates between channel centerlines, we use such multiplier. The following example in Figure 1 demonstrates its impact. As can bee seen in subplot c), the erosion rate might be slightly underpredicted.
library(rgdal) Original <- readOGR("..", "lower_mn_1938") Final <- readOGR("..", "lower_mn_2009") Years <- 71 spar <- 0.4 Step_pattern <- 'symmetricP05' Curvature_multiplier <- 1e5 Step <- 25 source('~/.qgis2/processing/rscripts/Channel migration.rsx') plotResult <- function() { zz <- subset(Migration, .35 < fr_from & fr_from < .377, drop=TRUE) plot(Original, xlim=bbox(zz)['x',], ylim=bbox(zz)['y',], col='IndianRed1', lwd=2) lines(Final, col='ForestGreen', lwd=2) for(l in coordinates(zz)[seq(1,length(zz),6)]) do.call('arrows', c(as.list(t(l[[1]])), length=.05, col='gray30')) grid(); axis(1); axis(2) } layout(matrix(1:4, ncol=2, byrow=TRUE)) plotResult(); title('a) downstream migration') both <- data.frame(rate=Migration$rate, case='a') Curvature_multiplier <- 0 source('~/.qgis2/processing/rscripts/Channel migration.rsx') plotResult(); title('b) lateral migration') both <- rbind(both, data.frame(rate=Migration$rate, case='b')) par(mar=c(5.1,5.1,2.1,2.1)) boxplot(rate*100~case, both, log='y', ylab=expression('Erosion rate,' ~~ cm ~~ yr^-1), main='c) rate comparison')
Figure 1: Migration of a section of Minnesota River a) with curvature b) spatial proximity only, and c) comparison of annual erosion rates