Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/GaugeDischargeCurveFacet.java @ 8724:47199406994a
(issue1801) Determine gauge at a station always with same tolerance.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Wed, 29 Apr 2015 12:30:57 +0200 |
parents | a9d493aba926 |
children | 5e38e2924c07 |
comparison
equal
deleted
inserted
replaced
8723:686d8876edf9 | 8724:47199406994a |
---|---|
23 import org.dive4elements.river.utils.RiverUtils; | 23 import org.dive4elements.river.utils.RiverUtils; |
24 | 24 |
25 import org.apache.log4j.Logger; | 25 import org.apache.log4j.Logger; |
26 | 26 |
27 import static org.dive4elements.river.exports.injector.InjectorConstants.PNP; | 27 import static org.dive4elements.river.exports.injector.InjectorConstants.PNP; |
28 import static org.dive4elements.river.exports.injector.InjectorConstants.GAUGE_EPSILON; | |
29 | 28 |
30 /** | 29 /** |
31 * A Facet that returns discharge curve data at a gauge | 30 * A Facet that returns discharge curve data at a gauge |
32 * | 31 * |
33 * @author <a href="mailto:bjoern.ricks@intevation.de">Björn Ricks</a> | 32 * @author <a href="mailto:bjoern.ricks@intevation.de">Björn Ricks</a> |
87 double km = Double.NaN; | 86 double km = Double.NaN; |
88 if (access.getLocations() != null && | 87 if (access.getLocations() != null && |
89 access.getLocations().length > 0) { | 88 access.getLocations().length > 0) { |
90 km = access.getLocations()[0]; | 89 km = access.getLocations()[0]; |
91 } | 90 } |
92 Gauge g = access.getRiver().determineGaugeByStation( | 91 Gauge g = access.getRiver().determineGaugeAtStation(km); |
93 km - GAUGE_EPSILON, | |
94 km + GAUGE_EPSILON); | |
95 if (g != null) { | 92 if (g != null) { |
96 return new WQKms( | 93 return new WQKms( |
97 kms, | 94 kms, |
98 values[0], | 95 values[0], |
99 transformToM(values[1], g.getDatum().doubleValue())); | 96 transformToM(values[1], g.getDatum().doubleValue())); |