comparison 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
comparison
equal deleted inserted replaced
2344:ec0ffc842573 2345:c3ea91aee989
199 * @return the first intersecting gauge. 199 * @return the first intersecting gauge.
200 */ 200 */
201 public Gauge determineGauge(double a, double b) { 201 public Gauge determineGauge(double a, double b) {
202 List<Gauge> gauges = determineGauges(a, b); 202 List<Gauge> gauges = determineGauges(a, b);
203 203
204 return gauges.isEmpty() ? null : gauges.get(0); 204 int idx = a < b ? 0 : gauges.size() - 1;
205
206 return gauges.isEmpty() ? null : gauges.get(idx);
205 } 207 }
206 208
207 /** 209 /**
208 * Returns the min and max distance of this river. The first position in the 210 * Returns the min and max distance of this river. The first position in the
209 * resulting array contains the min distance, the second position the max 211 * resulting array contains the min distance, the second position the max

http://dive4elements.wald.intevation.org