[PATCH 2 of 2] Draw lines with gaps for sounding width, and bed heights

Wald Commits scm-commit at wald.intevation.org
Thu Apr 3 14:11:09 CEST 2014


# HG changeset patch
# User Raimund Renkert <rrenkert at intevation.de>
# Date 1396527053 -7200
# Branch minfo-opt
# Node ID b2a8a94a92f9caf0cbcb0cc026b750e72022dc1f
# Parent  f97162606fa23bfe02ff33363e71dd9666f6fdc1
Draw lines with gaps for sounding width, and bed heights.

diff -r f97162606fa2 -r b2a8a94a92f9 artifacts/src/main/java/org/dive4elements/river/exports/process/BedHeightProcessor.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/process/BedHeightProcessor.java	Thu Apr 03 14:01:01 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/process/BedHeightProcessor.java	Thu Apr 03 14:10:53 2014 +0200
@@ -86,23 +86,32 @@
                     1d);
         } else if (data instanceof BedHeightSingleData) {
             BedHeightSingleData bData = (BedHeightSingleData)data;
-            double[] heights  = bData.getHeights();
-            double[] stations = bData.getStations().toNativeArray();
+            double[][] points = new double[][]
+                {bData.getStations().toNativeArray(), bData.getHeights()};
 
             logger.debug("doBedheightSingleOut");
-
-            for (int i = 0; i < heights.length; i++) {
-                series.add(stations[i], heights[i], false);
-            }
+            StyledSeriesBuilder.addPointsFactorY(series,
+                    points,
+                    false,
+                    GAP_TOLERANCE,
+                    1d);
         }
         else if (data instanceof List<?>) {
             List<BedHeightSingleValue> bData = (List<BedHeightSingleValue>)data;
+            double[][] points = new double[2][];
 
             logger.debug("doBedheightSingleValueOut");
 
-            for(BedHeightSingleValue bvalue: bData) {
-                series.add(bvalue.getStation(), bvalue.getHeight());
+            for(int i = 0; i < bData.size(); i++) {
+                BedHeightSingleValue bvalue = bData.get(i);
+                points[0][i] = bvalue.getStation();
+                points[1][i] = bvalue.getHeight();
             }
+            StyledSeriesBuilder.addPointsFactorY(series,
+                    points,
+                    false,
+                    GAP_TOLERANCE,
+                    1d);
         }
         else {
             logger.error("Unknown data type " + data.getClass());
diff -r f97162606fa2 -r b2a8a94a92f9 artifacts/src/main/java/org/dive4elements/river/exports/process/BedWidthProcessor.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/process/BedWidthProcessor.java	Thu Apr 03 14:01:01 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/process/BedWidthProcessor.java	Thu Apr 03 14:10:53 2014 +0200
@@ -52,7 +52,11 @@
         if (facetName.equals(FacetTypes.BED_DIFFERENCE_SOUNDING_WIDTH) &&
             data instanceof BedDiffYearResult) {
             BedDiffYearResult bData = (BedDiffYearResult) data;
-            StyledSeriesBuilder.addPoints(series, bData.getSoundingWidthData(), true);
+            StyledSeriesBuilder.addPoints(
+                series,
+                bData.getSoundingWidthData(),
+                false,
+                0.110d);
         } else if (facetName.equals(FacetTypes.BED_DIFFERENCE_MORPH_WIDTH1) &&
             data instanceof BedDiffYearResult) {
             BedDiffYearResult bData = (BedDiffYearResult) data;


More information about the Dive4Elements-commits mailing list