Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/StaticWKmsArtifact.java @ 2120:f021080cb409
Use improved caching for cross section lines data.
flys-artifacts/trunk@3690 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 16 Jan 2012 17:38:39 +0000 |
parents | 701658081f4f |
children | d626ae185305 |
comparison
equal
deleted
inserted
replaced
2119:dc28ea60b53d | 2120:f021080cb409 |
---|---|
28 import de.intevation.flys.artifacts.resources.Resources; | 28 import de.intevation.flys.artifacts.resources.Resources; |
29 | 29 |
30 import de.intevation.artifacts.common.utils.XMLUtils; | 30 import de.intevation.artifacts.common.utils.XMLUtils; |
31 | 31 |
32 import de.intevation.flys.geom.Lines; | 32 import de.intevation.flys.geom.Lines; |
33 import de.intevation.flys.model.CrossSectionLine; | 33 |
34 import de.intevation.flys.artifacts.model.FastCrossSectionLine; | |
34 | 35 |
35 /** | 36 /** |
36 * Artifact to access additional "waterlevel"-type of data, like the height | 37 * Artifact to access additional "waterlevel"-type of data, like the height |
37 * of protective measures (dikes). | 38 * of protective measures (dikes). |
38 * | 39 * |
254 * Get points of line describing the surface of water at cross section. | 255 * Get points of line describing the surface of water at cross section. |
255 * | 256 * |
256 * @return an array holding coordinates of points of surface of water ( | 257 * @return an array holding coordinates of points of surface of water ( |
257 * in the form {{x1, x2} {y1, y2}} ). | 258 * in the form {{x1, x2} {y1, y2}} ). |
258 */ | 259 */ |
259 public double [][] getWaterLines(int idx, CrossSectionLine csl) { | 260 @Override |
261 public double [][] getWaterLines(int idx, FastCrossSectionLine csl) { | |
260 logger.debug("getWaterLines(" + idx + ")"); | 262 logger.debug("getWaterLines(" + idx + ")"); |
261 | 263 |
262 List<Point2D> points = csl.fetchCrossSectionLinesPoints(); | 264 List<Point2D> points = csl.getPoints(); |
263 | 265 |
264 WKms wkms = getWKms(0); | 266 WKms wkms = getWKms(0); |
265 | 267 |
266 double km = csl.getKm().doubleValue(); | 268 double km = csl.getKm(); |
267 | 269 |
268 // Find W at km. | 270 // Find W at km. |
269 double wAtKm = getWAtKm(wkms, km); | 271 double wAtKm = getWAtKm(wkms, km); |
270 if (wAtKm == -1) { | 272 if (wAtKm == -1) { |
271 logger.warn("Waterlevel at km " + km + " unknown."); | 273 logger.warn("Waterlevel at km " + km + " unknown."); |