comparison gnv-artifacts/src/main/java/de/intevation/gnv/math/Interpolation2D.java @ 434:0eed5749fd63

Implemented the raster interpolation for the 'Profilschnitt'. gnv-artifacts/trunk@482 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 23 Dec 2009 15:28:40 +0000
parents 422275fc9927
children f42ed4f10b79
comparison
equal deleted inserted replaced
433:828df3ddb758 434:0eed5749fd63
89 double to, 89 double to,
90 int steps, 90 int steps,
91 Metrics metrics, 91 Metrics metrics,
92 Consumer consumer 92 Consumer consumer
93 ) { 93 ) {
94 boolean debug = log.isDebugEnabled();
95
94 int N = path.size(); 96 int N = path.size();
95 int M = points.size(); 97 int M = points.size();
96 98
97 if (log.isDebugEnabled()) { 99 if (debug) {
98 log.debug("Size of path: " + N); 100 log.debug("Size of path: " + N);
99 log.debug("Size of points: " + M); 101 log.debug("Size of points: " + M);
100 } 102 }
101 103
102 if (M < 1 || N < 2) { // nothing to do 104 if (M < 1 || N < 2) { // nothing to do
105 107
106 double [] buffer = calculateBuffer(points); 108 double [] buffer = calculateBuffer(points);
107 double dxMax = buffer[0]; 109 double dxMax = buffer[0];
108 double dyMax = buffer[1]; 110 double dyMax = buffer[1];
109 111
110 if (log.isDebugEnabled()) { 112 if (debug) {
111 log.debug("buffer size: " + dxMax + " / " + dyMax); 113 log.debug("buffer size: " + dxMax + " / " + dyMax);
112 } 114 }
113 115
114 // put into spatial index to speed up finding neighbors. 116 // put into spatial index to speed up finding neighbors.
115 Quadtree spatialIndex = new Quadtree(); 117 Quadtree spatialIndex = new Quadtree();
202 consumer.interpolated(center, false); 204 consumer.interpolated(center, false);
203 ++missedInterpolations; 205 ++missedInterpolations;
204 } 206 }
205 } 207 }
206 208
207 if (log.isDebugEnabled()) { 209 if (debug) {
208 log.debug("interpolations: " + 210 log.debug("interpolations: " +
209 interpolations + " / " + missedInterpolations); 211 interpolations + " / " + missedInterpolations);
210 } 212 }
211 } 213 }
212 214

http://dive4elements.wald.intevation.org