comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/Calculation4.java @ 671:e0e39a0eb3fe

Berechnung 4: Determine the gauges by their station position. This hopefully fixes segment assignment problems. flys-artifacts/trunk@2091 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 08 Jun 2011 19:11:18 +0000
parents 8124ca1ecaaa
children d5f9ba1d055f
comparison
equal deleted inserted replaced
670:8124ca1ecaaa 671:e0e39a0eb3fe
48 48
49 int numResults = -1; 49 int numResults = -1;
50 50
51 // assign reference points 51 // assign reference points
52 for (Segment segment: segments) { 52 for (Segment segment: segments) {
53 Gauge gauge = river.determineGauge( 53 Gauge gauge = river.determineGaugeByStation(
54 segment.getFrom(), segment.getTo()); 54 segment.getFrom(), segment.getTo());
55 55
56 segment.setReferencePoint(gauge != null 56 segment.setReferencePoint(gauge != null
57 ? gauge.getStation().doubleValue() 57 ? gauge.getStation().doubleValue()
58 : 0.5*(segment.getFrom() + segment.getTo())); 58 : 0.5*(segment.getFrom() + segment.getTo()));

http://dive4elements.wald.intevation.org