diff artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepthminmax/FlowDepthMinMaxCalculation.java @ 9375:a0a2e68a1e11

Fixed: cm rounding in S-Info flow depth/tkh and U-Info salix via BigDecimal, half_even mode
author mschaefer
date Fri, 03 Aug 2018 17:00:45 +0200
parents 392745cccede
children 8ae7137b67d7
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepthminmax/FlowDepthMinMaxCalculation.java	Thu Aug 02 20:14:26 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepthminmax/FlowDepthMinMaxCalculation.java	Fri Aug 03 17:00:45 2018 +0200
@@ -135,8 +135,8 @@
                 final double maxBedHeightValue = bedHeight.getMaxBedHeight(station);
                 final double meanBedHeight = bedHeight.getMeanBedHeight(station);
 
-                final double minFlowDepth = Math.max(Formatter.roundFlowDepth(wst) - Formatter.roundFlowDepth(maxBedHeightValue), 0.0);
-                final double maxFlowDepth = Math.max(Formatter.roundFlowDepth(wst) - Formatter.roundFlowDepth(minBedHeightValue), 0.0);
+                final double minFlowDepth = Math.max(Formatter.roundFlowDepth(wst).subtract(Formatter.roundFlowDepth(maxBedHeightValue)).doubleValue(), 0.0);
+                final double maxFlowDepth = Math.max(Formatter.roundFlowDepth(wst).subtract(Formatter.roundFlowDepth(minBedHeightValue)).doubleValue(), 0.0);
 
                 // REMARK: access the location once only during calculation
                 final String location = riverInfoProvider.getLocation(station);

http://dive4elements.wald.intevation.org