Mercurial > dive4elements > river
changeset 2345:c3ea91aee989
Bugfix: #333 Improved determination of reference gauge based on start km.
flys-backend/trunk@2876 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 04 Oct 2011 05:06:10 +0000 |
parents | ec0ffc842573 |
children | f834b411ca57 |
files | flys-backend/ChangeLog flys-backend/src/main/java/de/intevation/flys/model/River.java |
diffstat | 2 files changed, 11 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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 <ingo@intevation.de> + + 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 <felix.wolfsteller@intevation.de> * src/main/java/de/intevation/flys/utils/StringUtil.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<Gauge> 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); } /**