comparison 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
comparison
equal deleted inserted replaced
1801:6f83d9d434f2 1802:26d7077e42d2
187 public String getName() { 187 public String getName() {
188 return ARTIFACT_NAME; 188 return ARTIFACT_NAME;
189 } 189 }
190 190
191 191
192 protected void appendBackgroundActivity( 192 protected static void appendBackgroundActivity(
193 ElementCreator cr, 193 ElementCreator cr,
194 Element root, 194 Element root,
195 CallContext context 195 CallContext context
196 ) { 196 ) {
197 Element inBackground = cr.create("background-processing"); 197 Element inBackground = cr.create("background-processing");
742 * Get points of line describing the surface of water at cross section. 742 * Get points of line describing the surface of water at cross section.
743 * 743 *
744 * @return an array holding coordinates of points of surface of water ( 744 * @return an array holding coordinates of points of surface of water (
745 * in the form {{x1, x2} {y1, y2}} ). 745 * in the form {{x1, x2} {y1, y2}} ).
746 */ 746 */
747 public double [][] getWaterLines() { 747 public double [][] getWaterLines(int idx) {
748 logger.debug("getWaterLines()"); 748 logger.debug("getWaterLines()");
749 CrossSectionLine csl = searchCrossSectionKmLine(); 749 CrossSectionLine csl = searchCrossSectionKmLine();
750 List<Point2D> points = csl.fetchCrossSectionLinesPoints(); 750 List<Point2D> points = csl.fetchCrossSectionLinesPoints();
751
751 // Need W at km 752 // Need W at km
752 WQKms [] wqkms = (WQKms[]) getWaterlevelData().getData(); 753 WQKms [] wqkms = (WQKms[]) getWaterlevelData().getData();
753 if (wqkms.length == 0) { 754 if (wqkms.length == 0) {
754 logger.error("No WQKms found."); 755 logger.error("No WQKms found.");
755 return Lines.createWaterLines(points, 0.0f); 756 return Lines.createWaterLines(points, 0.0f);
756 } 757 }
757 758
758 if (wqkms.length > 1) { 759 if (wqkms.length < idx) {
759 logger.warn("More than one wqkms found, taking first one."); 760 logger.error("getWaterLines() requested index ("
760 } 761 + idx + " not found.");
762 }
763
761 // Find W at km, linear naive approach. 764 // Find W at km, linear naive approach.
762 WQKms triple = wqkms[0]; 765 WQKms triple = wqkms[idx];
766
763 // Find index of km. 767 // Find index of km.
764 double wishKM = 0.0f; 768 double wishKM = 0.0f;
765 int old_idx = 0; 769 int old_idx = 0;
766 try { 770 try {
767 wishKM = Double.parseDouble(getDataAsString("cross_section.km")); 771 wishKM = Double.parseDouble(getDataAsString("cross_section.km"));

http://dive4elements.wald.intevation.org