Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFactory.java @ 6968:6b9402377d07
issue1465: Fetch correct measurement station (also if the km does not
match the measurementstation.station, but falls within its range.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Thu, 05 Sep 2013 15:46:57 +0200 |
parents | 3a987e9af256 |
children | c137f5028591 |
comparison
equal
deleted
inserted
replaced
6967:3a987e9af256 | 6968:6b9402377d07 |
---|---|
488 | 488 |
489 protected static Range findMeasurementStationRange( | 489 protected static Range findMeasurementStationRange( |
490 TreeMap<Double, MeasurementStation> stations, | 490 TreeMap<Double, MeasurementStation> stations, |
491 double km | 491 double km |
492 ) { | 492 ) { |
493 MeasurementStation station = stations.get(km); | 493 MeasurementStation station = stations.floorEntry(km).getValue(); |
494 if (station == null) { | 494 if (station == null || !station.getRange().contains(km)) { |
495 return null; | 495 return null; |
496 } | 496 } |
497 | 497 |
498 double endKm; | 498 double endKm; |
499 | 499 |