diff gnv-artifacts/src/main/java/de/intevation/gnv/math/Interpolation2D.java @ 445:f42ed4f10b79

Fixed some bugs and create "Profilschnitt" polygons via configuration. gnv-artifacts/trunk@493 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 30 Dec 2009 23:02:10 +0000
parents 0eed5749fd63
children ab29e4ff2fda
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/math/Interpolation2D.java	Wed Dec 30 10:35:19 2009 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/math/Interpolation2D.java	Wed Dec 30 23:02:10 2009 +0000
@@ -39,15 +39,15 @@
             Point2d p = points.get(k);
 
             ArrayList<Point2d> jList = jMap.get(p.j);
-            ArrayList<Point2d> iList = jMap.get(p.i);
+            ArrayList<Point2d> iList = iMap.get(p.i);
 
             if (jList == null) {
-                iMap.put(p.j, jList = new ArrayList<Point2d>());
+                jMap.put(p.j, jList = new ArrayList<Point2d>());
             }
             jList.add(p);
 
             if (iList == null) {
-                jMap.put(p.i, iList = new ArrayList<Point2d>());
+                iMap.put(p.i, iList = new ArrayList<Point2d>());
             }
             iList.add(p);
         }
@@ -58,7 +58,7 @@
         for (ArrayList<Point2d> v: jMap.values()) {
             Collections.sort(v, Point2d.Y_COMPARATOR);
             for (int i = 1, L = v.size(); i < L; ++i) {
-                double dy = Math.abs(v.get(i).x - v.get(i-1).x);
+                double dy = Math.abs(v.get(i).y - v.get(i-1).y);
                 if (dy > dyMax) {
                     dyMax = dy;
                 }

http://dive4elements.wald.intevation.org