changeset 5985:2ec6fae23bba

Be more tolerant when try to find out if a location is at a gauge position.
author Sascha L. Teichmann <teichmann@intevation.de>
date Fri, 10 May 2013 19:29:10 +0200
parents 45bcc127e7df
children 600280716e25
files artifacts/src/main/java/org/dive4elements/river/exports/ComputedDischargeCurveExporter.java
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/ComputedDischargeCurveExporter.java	Fri May 10 19:07:00 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/ComputedDischargeCurveExporter.java	Fri May 10 19:29:10 2013 +0200
@@ -135,11 +135,13 @@
         double[] km = access.getLocations();
         String header =
             msg(CSV_W_HEADER, DEFAULT_CSV_W_HEADER, new Object[] { unit });
+
         if (km != null) {
             List<Gauge>gauges = GaugesFactory.getGauges(access.getRiver());
-            for (Gauge g : gauges) {
-                if (g.getStation().doubleValue() == km[0]) {
+            for (Gauge g: gauges) {
+                if (Math.abs(g.getStation().doubleValue() - km[0]) < 0.0001d) {
                     header = "W [cm]";
+                    break;
                 }
             }
         }

http://dive4elements.wald.intevation.org