# HG changeset patch # User Ingo Weinzierl # Date 1317704770 0 # Node ID c3ea91aee9899095e7fe382c020fa9914c2a5d39 # Parent ec0ffc842573c5b667b9755ec2f29cf8f2a41a94 Bugfix: #333 Improved determination of reference gauge based on start km. flys-backend/trunk@2876 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r ec0ffc842573 -r c3ea91aee989 flys-backend/ChangeLog --- a/flys-backend/ChangeLog Wed Sep 28 15:35:54 2011 +0000 +++ b/flys-backend/ChangeLog Tue Oct 04 05:06:10 2011 +0000 @@ -1,3 +1,11 @@ +2011-10-04 Ingo Weinzierl + + flys/issue333 (W-INFO / Berechnung Wasserspiegellage, Zuordnung Bezugspegel) + + * src/main/java/de/intevation/flys/model/River.java: Modified + determination of gauge based on a km range. River.determineGauge(double, + double) will now return the gauge which matches the start km. + 2011-09-28 Felix Wolfsteller * src/main/java/de/intevation/flys/utils/StringUtil.java: diff -r ec0ffc842573 -r c3ea91aee989 flys-backend/src/main/java/de/intevation/flys/model/River.java --- a/flys-backend/src/main/java/de/intevation/flys/model/River.java Wed Sep 28 15:35:54 2011 +0000 +++ b/flys-backend/src/main/java/de/intevation/flys/model/River.java Tue Oct 04 05:06:10 2011 +0000 @@ -201,7 +201,9 @@ public Gauge determineGauge(double a, double b) { List gauges = determineGauges(a, b); - return gauges.isEmpty() ? null : gauges.get(0); + int idx = a < b ? 0 : gauges.size() - 1; + + return gauges.isEmpty() ? null : gauges.get(idx); } /**