Mercurial > dive4elements > gnv-client
comparison 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 |
comparison
equal
deleted
inserted
replaced
444:85f48e287fb3 | 445:f42ed4f10b79 |
---|---|
37 | 37 |
38 for (int k = points.size()-1; k >= 0; --k) { | 38 for (int k = points.size()-1; k >= 0; --k) { |
39 Point2d p = points.get(k); | 39 Point2d p = points.get(k); |
40 | 40 |
41 ArrayList<Point2d> jList = jMap.get(p.j); | 41 ArrayList<Point2d> jList = jMap.get(p.j); |
42 ArrayList<Point2d> iList = jMap.get(p.i); | 42 ArrayList<Point2d> iList = iMap.get(p.i); |
43 | 43 |
44 if (jList == null) { | 44 if (jList == null) { |
45 iMap.put(p.j, jList = new ArrayList<Point2d>()); | 45 jMap.put(p.j, jList = new ArrayList<Point2d>()); |
46 } | 46 } |
47 jList.add(p); | 47 jList.add(p); |
48 | 48 |
49 if (iList == null) { | 49 if (iList == null) { |
50 jMap.put(p.i, iList = new ArrayList<Point2d>()); | 50 iMap.put(p.i, iList = new ArrayList<Point2d>()); |
51 } | 51 } |
52 iList.add(p); | 52 iList.add(p); |
53 } | 53 } |
54 | 54 |
55 double dxMax = -Double.MAX_VALUE; | 55 double dxMax = -Double.MAX_VALUE; |
56 double dyMax = -Double.MAX_VALUE; | 56 double dyMax = -Double.MAX_VALUE; |
57 | 57 |
58 for (ArrayList<Point2d> v: jMap.values()) { | 58 for (ArrayList<Point2d> v: jMap.values()) { |
59 Collections.sort(v, Point2d.Y_COMPARATOR); | 59 Collections.sort(v, Point2d.Y_COMPARATOR); |
60 for (int i = 1, L = v.size(); i < L; ++i) { | 60 for (int i = 1, L = v.size(); i < L; ++i) { |
61 double dy = Math.abs(v.get(i).x - v.get(i-1).x); | 61 double dy = Math.abs(v.get(i).y - v.get(i-1).y); |
62 if (dy > dyMax) { | 62 if (dy > dyMax) { |
63 dyMax = dy; | 63 dyMax = dy; |
64 } | 64 } |
65 } | 65 } |
66 } | 66 } |