changeset 1676:6e840e213fdf

Backjump correction: Finally looks fine. flys-artifacts/trunk@2893 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 05 Oct 2011 10:36:40 +0000
parents 19d0eb41e923
children dd9dfe1e48fa
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/math/BackJumpCorrector.java
diffstat 2 files changed, 15 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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	<sascha.teichmann@intevation.de>
+
+	* 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 <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/artifacts/AnnotationArtifact.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]);
                 }
             }

http://dive4elements.wald.intevation.org