# HG changeset patch # User Sascha L. Teichmann # Date 1317811000 0 # Node ID 6e840e213fdf2b5005e03f6ced11c125017e60b5 # Parent 19d0eb41e923c93332ef11f9b23a368fe688778a Backjump correction: Finally looks fine. flys-artifacts/trunk@2893 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 19d0eb41e923 -r 6e840e213fdf flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Wed Oct 05 10:26:54 2011 +0000 +++ b/flys-artifacts/ChangeLog Wed Oct 05 10:36:40 2011 +0000 @@ -1,3 +1,8 @@ +2011-10-04 Sascha L. Teichmann + + * src/main/java/de/intevation/flys/artifacts/math/BackJumpCorrector.java: + Lifted the wrong point. Now all backjump corrections look fine. :-) + 2011-10-05 Ingo Weinzierl * src/main/java/de/intevation/flys/artifacts/AnnotationArtifact.java: diff -r 19d0eb41e923 -r 6e840e213fdf flys-artifacts/src/main/java/de/intevation/flys/artifacts/math/BackJumpCorrector.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/math/BackJumpCorrector.java Wed Oct 05 10:26:54 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/math/BackJumpCorrector.java Wed Oct 05 10:36:40 2011 +0000 @@ -133,10 +133,10 @@ double between = above + quarterDistance; - double betweenHeight = ws[i] + 0.25*(startHeight - ws[i]); + double aboveHeight = ws[i] + 0.25*(startHeight - ws[i]); - double [] x = { start, between, km[i] }; - double [] y = { startHeight, betweenHeight, ws[i] }; + double [] x = { start, above, between }; + double [] y = { startHeight, aboveHeight, ws[i] }; if (log.isDebugEnabled()) { for (int j = 0; j < x.length; ++j) { @@ -168,7 +168,13 @@ } } - for (int j = i-1; j > 0 && ws[j] < startHeight; --j) { + int j = i-1; + + for (; j >= 0 && km[j] >= between; --j) { + ws[j] = ws[i]; + } + + for (; j >= 0 && ws[j] < startHeight; --j) { ws[j] = spline.value(km[j]); } }