comparison gnv-artifacts/src/main/java/de/intevation/gnv/math/Interpolation3D.java @ 519:4e347624ee7c

Last part to fix gnv/issue153. Now 'Profilschnitte', 'Horizontalschnitte' and 'horizontale Schnittprofile' all use the same x/y interpolation code. gnv-artifacts/trunk@613 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Sat, 23 Jan 2010 21:16:45 +0000
parents 464e03bf786b
children 1bf058f1a2d1
comparison
equal deleted inserted replaced
518:464e03bf786b 519:4e347624ee7c
96 96
97 if (M < 1 || N < 2) { // nothing to do 97 if (M < 1 || N < 2) { // nothing to do
98 return false; 98 return false;
99 } 99 }
100 100
101 Envelope relevantArea = null; 101 Envelope relevantArea = M > CULL_POINT_THRESHOLD
102 ? Interpolation2D.pathBoundingBox(path, 0.05d)
103 : null;
102 104
103 if (M > CULL_POINT_THRESHOLD) {
104
105 relevantArea = new Envelope(path.get(N-1));
106
107 for (int i = N-2; i >= 0; --i) {
108 relevantArea.expandToInclude(path.get(i));
109 }
110
111 relevantArea.expandBy(
112 0.05d*relevantArea.getWidth(),
113 0.05d*relevantArea.getHeight());
114 }
115
116 List<GridCell> cells = GridCell.pointsToGridCells( 105 List<GridCell> cells = GridCell.pointsToGridCells(
117 points, relevantArea); 106 points, relevantArea);
118 107
119 if (cells.isEmpty()) { 108 if (cells.isEmpty()) {
120 log.warn("no cells found"); 109 log.warn("no cells found");

http://dive4elements.wald.intevation.org