[PATCH 4 of 5] (issue1754) Better fix for radius calculation then 8607:2010da0904b7

Wald Commits scm-commit at wald.intevation.org
Tue Mar 24 11:09:23 CET 2015


# HG changeset patch
# User Andre Heinecke <andre.heinecke at intevation.de>
# Date 1427191607 -3600
# Node ID 421e5cceac842f8c66a2a47cdab8d6db711cc514
# Parent  0f6f702742b4e09da89e66feae6c4c3d38d26ef0
(issue1754) Better fix for radius calculation then 8607:2010da0904b7

    Checking for that lower < upper is guranteed in radius calculation
    makes more sense to do centrally in ZoomScale. This also works
    for the MINFO Filter facets.

diff -r 0f6f702742b4 -r 421e5cceac84 artifacts/src/main/java/org/dive4elements/river/artifacts/model/DifferenceCurveFilterFacet.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/DifferenceCurveFilterFacet.java	Tue Mar 24 10:52:23 2015 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/DifferenceCurveFilterFacet.java	Tue Mar 24 11:06:47 2015 +0100
@@ -39,11 +39,6 @@
         Double start = (Double)context.getContextValue("startkm");
         Double end = (Double)context.getContextValue("endkm");
         if(start != null && end != null) {
-            if (start > end) {
-                Double buf = start;
-                start = end;
-                end = buf;
-            }
             RiverContext fc = (RiverContext)context.globalContext();
             // Adaptive smoothing, based on zoom factor/diagram extents.
             ZoomScale scales = (ZoomScale)fc.get("zoomscale");
diff -r 0f6f702742b4 -r 421e5cceac84 artifacts/src/main/java/org/dive4elements/river/artifacts/model/ZoomScale.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/ZoomScale.java	Tue Mar 24 10:52:23 2015 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/ZoomScale.java	Tue Mar 24 11:06:47 2015 +0100
@@ -35,6 +35,11 @@
     }
 
     public double getRadius(String river, double lower, double upper) {
+        if (lower > upper) {
+            double buf = lower;
+            lower = upper;
+            upper = buf;
+        }
         double range = Math.abs(upper) - Math.abs(lower);
         TreeMap<Double, Double> ranges = rivers.get(river);
         if (ranges == null) {


More information about the Dive4Elements-commits mailing list