changeset 8472:3f505fba522f

(issue1772) Use 0.001km tolarance instead of 0.1 to find matching km. There is no sense to use a define here. I will not write static final double NULLPOINTNULLNULLONE=0.001 if i just want to use that value and not any other value which may make sense in some other place. Using hardcoded values can have its merits and makes the code easier to read.
author Andre Heinecke <andre.heinecke@intevation.de>
date Tue, 18 Nov 2014 15:24:40 +0100
parents a846a3d910a0
children 1ba3032cdfe2
files artifacts/src/main/java/org/dive4elements/river/exports/process/FixWQProcessor.java
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/process/FixWQProcessor.java	Thu Nov 13 13:28:45 2014 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/process/FixWQProcessor.java	Tue Nov 18 15:24:40 2014 +0100
@@ -452,7 +452,9 @@
 
             double[] kms = wqkms.getKms();
             for (int i = 0 ; i< kms.length; i++) {
-                if (Math.abs(kms[i] - ckm) <= GAUGE_EPSILON) {
+                /* We use a tolerance of 1m here to find a hit.
+                 * Probably to avoid some rounding errors. */
+                if (Math.abs(kms[i] - ckm) <= 0.001) {
                     series.add(wqkms.getQ(i), wqkms.getW(i), false);
                     generator.addAxisSeries(series, axisName, visible);
                     if(visible && theme.parseShowPointLabel()) {

http://dive4elements.wald.intevation.org