Mercurial > dive4elements > river
diff flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java @ 1802:26d7077e42d2
Corrected CrossSection diagram/out to include one facet per computed waterlevel.
flys-artifacts/trunk@3126 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Tue, 01 Nov 2011 10:40:05 +0000 |
parents | a8aa343799a2 |
children | 51e59f221333 |
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java Mon Oct 31 17:05:14 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java Tue Nov 01 10:40:05 2011 +0000 @@ -189,7 +189,7 @@ } - protected void appendBackgroundActivity( + protected static void appendBackgroundActivity( ElementCreator cr, Element root, CallContext context @@ -744,10 +744,11 @@ * @return an array holding coordinates of points of surface of water ( * in the form {{x1, x2} {y1, y2}} ). */ - public double [][] getWaterLines() { + public double [][] getWaterLines(int idx) { logger.debug("getWaterLines()"); CrossSectionLine csl = searchCrossSectionKmLine(); List<Point2D> points = csl.fetchCrossSectionLinesPoints(); + // Need W at km WQKms [] wqkms = (WQKms[]) getWaterlevelData().getData(); if (wqkms.length == 0) { @@ -755,11 +756,14 @@ return Lines.createWaterLines(points, 0.0f); } - if (wqkms.length > 1) { - logger.warn("More than one wqkms found, taking first one."); + if (wqkms.length < idx) { + logger.error("getWaterLines() requested index (" + + idx + " not found."); } + // Find W at km, linear naive approach. - WQKms triple = wqkms[0]; + WQKms triple = wqkms[idx]; + // Find index of km. double wishKM = 0.0f; int old_idx = 0;