diff flys-backend/src/main/java/de/intevation/flys/model/River.java @ 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 321b9e480f72
children 0acf28a3d28a
line wrap: on
line diff
--- 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);
     }
 
     /**

http://dive4elements.wald.intevation.org