diff artifacts/src/main/java/org/dive4elements/river/artifacts/model/river/RiverInfoProvider.java @ 9505:3f230fe8eb19

Bezugspegel-assignment changed for coinciding gauge and calculation range (Meilenstein-2 2.2.4)
author mschaefer
date Fri, 28 Sep 2018 10:16:12 +0200
parents 853f2dafc16e
children 1722727803f7
line wrap: on
line diff
--- 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);

http://dive4elements.wald.intevation.org