[Dive4elements-commits] [PATCH 2 of 3] Fixed epsilon calc in ATExporter

Wald Commits scm-commit at wald.intevation.org
Thu Jan 31 20:15:23 CET 2013


# HG changeset patch
# User Sascha L. Teichmann <teichmann at intevation.de>
# Date 1359659490 -3600
# Node ID 64139914e446959cf2f5f529f7d2e31c4da209ff
# Parent  7669747d22f2d591e7dc7aa283fcf663f26caa64
Fixed epsilon calc in ATExporter.

diff -r 7669747d22f2 -r 64139914e446 flys-artifacts/src/main/java/de/intevation/flys/exports/ATExporter.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/ATExporter.java	Thu Jan 31 20:09:37 2013 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/ATExporter.java	Thu Jan 31 20:11:30 2013 +0100
@@ -3,7 +3,6 @@
 import java.io.OutputStream;
 import java.io.OutputStreamWriter;
 import java.io.IOException;
-import java.util.List;
 
 import org.w3c.dom.Document;
 
@@ -92,7 +91,7 @@
         double[] kms = rangeAccess.getLocations();
 
         Gauge gauge = river.determineGaugeByPosition(kms[0]);
-        if (kms[0] == gauge.getStation().doubleValue() + 1e-4) {
+        if (Math.abs(kms[0] - gauge.getStation().doubleValue()) < 1e-4) {
             // at gauge.
             TimeInterval interval =
                 gauge.fetchMasterDischargeTable().getTimeInterval();


More information about the Dive4elements-commits mailing list