changeset 6498:686bbfeacfe5

issue1235: sort km when running over them for total sediment load.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Fri, 28 Jun 2013 13:59:15 +0200
parents 4f9ad0366977
children 857f4d51d859
files artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadCalculation.java
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadCalculation.java	Fri Jun 28 11:30:35 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadCalculation.java	Fri Jun 28 13:59:15 2013 +0200
@@ -11,6 +11,7 @@
 import gnu.trove.TDoubleArrayList;
 
 import java.util.ArrayList;
+import java.util.TreeSet;
 import java.util.List;
 
 import org.apache.log4j.Logger;
@@ -345,7 +346,9 @@
         Range lastSuspRange = null;
         double lastSuspValue = 0d;
 
-        for (double km: load.getKms()) {
+        TreeSet<Double> kms = new TreeSet<Double>(load.getKms());
+
+        for (double km: kms) {
             logger.debug ("Trying to add at km " + km);
             SedimentLoadFraction fraction = load.getFraction(km);
             if (complete(fraction)) {

http://dive4elements.wald.intevation.org