[PATCH 4 of 4] Bezugspegel-assignment changed for coinciding gauge and calculation range (Meilenstein-2 2.2.4)

Wald Commits scm-commit at wald.intevation.org
Fri Sep 28 10:16:42 CEST 2018


# HG changeset patch
# User mschaefer
# Date 1538122572 -7200
# Node ID 3f230fe8eb196086d918fbf1ba2b6f440c6335cf
# Parent  76c0665888a318e1c608acd9fa9a09d5682bc855
Bezugspegel-assignment changed for coinciding gauge and calculation range (Meilenstein-2 2.2.4)

diff -r 76c0665888a3 -r 3f230fe8eb19 artifacts/src/main/java/org/dive4elements/river/artifacts/bundu/bezugswst/BezugswstCalculation.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/bundu/bezugswst/BezugswstCalculation.java	Fri Sep 28 10:13:09 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/bundu/bezugswst/BezugswstCalculation.java	Fri Sep 28 10:16:12 2018 +0200
@@ -39,7 +39,6 @@
 import org.dive4elements.river.model.BedHeightValueType;
 import org.dive4elements.river.model.River;
 import org.dive4elements.river.utils.DoubleUtil;
-import org.dive4elements.river.utils.Formatter;
 
 class BezugswstCalculation {
 
@@ -198,7 +197,7 @@
         final double msh = bedHeightsFinder.getMeanBedHeight(station);
         row.putValue(SInfoResultType.meanBedHeight, msh);
         if (!Double.isNaN(w) && !Double.isNaN(msh))
-            row.putValue(SInfoResultType.flowdepth, Formatter.roundFlowDepth(w).subtract(Formatter.roundFlowDepth(msh)).doubleValue());
+            row.putValue(SInfoResultType.flowdepth, w - msh);
         else
             row.putValue(SInfoResultType.flowdepth, Double.NaN);
 
@@ -206,7 +205,7 @@
         row.putValue(BunduResultType.channelDepth, channelDepth);
         double channelHeight;
         if (!Double.isNaN(w) && !Double.isNaN(channelDepth))
-            channelHeight = Formatter.roundFlowDepth(w).subtract(Formatter.roundFlowDepth(channelDepth)).doubleValue();
+            channelHeight = w - channelDepth;
         else
             channelHeight = Double.NaN;
         row.putValue(BunduResultType.channelLowerEdge, channelHeight);
diff -r 76c0665888a3 -r 3f230fe8eb19 artifacts/src/main/java/org/dive4elements/river/artifacts/model/river/RiverInfoProvider.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/river/RiverInfoProvider.java	Fri Sep 28 10:13:09 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/river/RiverInfoProvider.java	Fri Sep 28 10:16:12 2018 +0200
@@ -48,6 +48,12 @@
         else
             gauges = river.determineGauges(calcRange.getMinimumDouble(), calcRange.getMaximumDouble());
 
+        // If the range starts exactly at a gauge's range end, determineGauges gets this gauge as the first in list,
+        // but we want the list to start with the next gauge, i.e. that one that starts with the calc range,
+        // therefore we remove the first one
+        // REMARK Bei abwärts kilometriertem Fluss den letzten Gauge in der Liste prüfen (Ende)/entfernen
+        if ((gauges.size() >= 2) && (Math.abs(gauges.get(0).getRange().getB().doubleValue() - calcRange.getMinimumDouble()) < 0.0001))
+            gauges.remove(0);
         final GaugeIndex gaugeIndex = new GaugeIndex(gauges);
 
         final String notinrange = Resources.getMsg(context.getMeta(), CSV_NOT_IN_GAUGE_RANGE, CSV_NOT_IN_GAUGE_RANGE);


More information about the Dive4Elements-commits mailing list