[PATCH] Do not filter cross section points for display

Wald Commits scm-commit at wald.intevation.org
Fri Apr 28 19:41:30 CEST 2017


# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1493399036 -7200
# Node ID 8abe94270f32cba724c4f4c9aa76ac0e05f4a4f8
# Parent  8ce2d749f0a7e24272e0eae2a2c3a8c70589b2a0
Do not filter cross section points for display.

Filtering coordinates outside an extent probably aimed at omitting
outliers from the diagram. This is obsolete and had the side effect of
filtering the important point at x = 0.

diff -r 8ce2d749f0a7 -r 8abe94270f32 backend/src/main/java/org/dive4elements/river/model/CrossSection.java
--- a/backend/src/main/java/org/dive4elements/river/model/CrossSection.java	Thu Apr 13 15:25:26 2017 +0200
+++ b/backend/src/main/java/org/dive4elements/river/model/CrossSection.java	Fri Apr 28 19:03:56 2017 +0200
@@ -201,11 +201,7 @@
                 points = new ArrayList<Point2D>(500);
             }
 
-            Point2D p = new Point2D.Double(x, y);
-
-            if (CrossSectionLine.isValid(p)) {
-                points.add(p);
-            }
+            points.add(new Point2D.Double(x, y));
 
             lastKm = km;
             lastId = id;
diff -r 8ce2d749f0a7 -r 8abe94270f32 backend/src/main/java/org/dive4elements/river/model/CrossSectionLine.java
--- a/backend/src/main/java/org/dive4elements/river/model/CrossSectionLine.java	Thu Apr 13 15:25:26 2017 +0200
+++ b/backend/src/main/java/org/dive4elements/river/model/CrossSectionLine.java	Fri Apr 28 19:03:56 2017 +0200
@@ -39,9 +39,6 @@
 
     public static final double EPSILON   = 1e-4;
 
-    public static final double TOO_SMALL = 0.2;
-    public static final double TOO_BIG   = 2500;
-
     private Integer                 id;
     private Double                  km;
     private CrossSection            crossSection;
@@ -63,16 +60,6 @@
         };
 
 
-    public static final boolean isValid(double x) {
-        x = Math.abs(x);
-        return x > TOO_SMALL && x < TOO_BIG;
-    }
-
-    public static final boolean isValid(Point2D p) {
-        return isValid(p.getX()) && isValid(p.getY());
-    }
-
-
     public CrossSectionLine() {
     }
 
@@ -139,9 +126,7 @@
         for (CrossSectionPoint p: linePoints) {
             double x = p.getX().doubleValue();
             double y = p.getY().doubleValue();
-            if (isValid(x) && isValid(y)) {
-                points.add(new Point2D.Double(x, y));
-            }
+            points.add(new Point2D.Double(x, y));
         }
 
         return points;


More information about the Dive4Elements-commits mailing list