Mercurial > dive4elements > river
changeset 8813:8abe94270f32
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.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Fri, 28 Apr 2017 19:03:56 +0200 |
parents | 8ce2d749f0a7 |
children | 19fa9fc39fa2 |
files | backend/src/main/java/org/dive4elements/river/model/CrossSection.java backend/src/main/java/org/dive4elements/river/model/CrossSectionLine.java |
diffstat | 2 files changed, 2 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- 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;
--- 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;