Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/exports/injector/PNPInjector.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 | f5461750e5c7 |
children | a805211690f7 |
comparison
equal
deleted
inserted
replaced
8723:686d8876edf9 | 8724:47199406994a |
---|---|
11 import org.w3c.dom.Document; | 11 import org.w3c.dom.Document; |
12 import org.w3c.dom.Element; | 12 import org.w3c.dom.Element; |
13 | 13 |
14 import static org.dive4elements.river.exports.injector.InjectorConstants.CURRENT_KM; | 14 import static org.dive4elements.river.exports.injector.InjectorConstants.CURRENT_KM; |
15 import static org.dive4elements.river.exports.injector.InjectorConstants.PNP; | 15 import static org.dive4elements.river.exports.injector.InjectorConstants.PNP; |
16 import static org.dive4elements.river.exports.injector.InjectorConstants.GAUGE_EPSILON; | |
17 | 16 |
18 public class PNPInjector | 17 public class PNPInjector |
19 implements ContextInjector | 18 implements ContextInjector |
20 { | 19 { |
21 | 20 |
49 log.error("River not accessible from artifact. Not injecting PNP"); | 48 log.error("River not accessible from artifact. Not injecting PNP"); |
50 return; | 49 return; |
51 } | 50 } |
52 | 51 |
53 Gauge gauge = | 52 Gauge gauge = |
54 river.determineGaugeByStation( | 53 river.determineGaugeAtStation(km); |
55 km - GAUGE_EPSILON, | |
56 km + GAUGE_EPSILON); | |
57 | |
58 if (gauge == null) { | 54 if (gauge == null) { |
59 log.debug("no gauge found at current km. not injecting pnp"); | 55 log.debug("no gauge found at current km. not injecting pnp"); |
60 return; | 56 return; |
61 } | 57 } |
62 log.debug("injecting pnp: " + gauge.getDatum()); | 58 log.debug("injecting pnp: " + gauge.getDatum()); |