[PATCH] issue1466: Fix, sort stations before gap detection

Wald Commits scm-commit at wald.intevation.org
Thu Aug 29 11:23:13 CEST 2013


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1377768810 -7200
# Node ID 274948f91dd65b61d23e34e292705fbd8dc38eb8
# Parent  765cf5fe26c369a1d2a02ae9a706280326cff3bf
issue1466: Fix, sort stations before gap detection.

diff -r 765cf5fe26c3 -r 274948f91dd6 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFacet.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFacet.java	Thu Aug 29 09:14:53 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFacet.java	Thu Aug 29 11:33:30 2013 +0200
@@ -31,6 +31,7 @@
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
+import java.util.TreeSet;
 import java.util.TreeMap;
 
 import org.apache.log4j.Logger;
@@ -105,7 +106,7 @@
             TDoubleArrayList xPos = new TDoubleArrayList();
             TDoubleArrayList yPos = new TDoubleArrayList();
             double lastX = -1d;
-            for (double km: load.getKms()) {
+            for (double km: new TreeSet<Double>(load.getKms())) {
                 SedimentLoadFraction fraction = load.getFraction(km);
                 if (fraction.getTotal() != 0) {
                     if (Math.abs(lastX-km) >= EPSILON) {


More information about the Dive4elements-commits mailing list