comparison artifacts/src/main/java/org/dive4elements/river/artifacts/services/MainValuesService.java @ 6061:e9a76ffa0f9a

Use maxOverlap to get the correct gauge for the MainValues Previously just the first matching gauge was taken even if it's range ended with the minimum value. This code is clearly intended to get one gauge for one range so the best match should be taken.
author Andre Heinecke <aheinecke@intevation.de>
date Wed, 22 May 2013 18:10:48 +0200
parents af13ceeba52a
children e296c05a0c5b
comparison
equal deleted inserted replaced
6060:0a200ba54461 6061:e9a76ffa0f9a
77 if (river == null) { 77 if (river == null) {
78 return error("no river found."); 78 return error("no river found.");
79 } 79 }
80 80
81 double[] minmax = getRequestedStartEnd(data, river); 81 double[] minmax = getRequestedStartEnd(data, river);
82 Gauge gauge = river.determineGauge(minmax[0], minmax[1]); 82 Gauge gauge = river.maxOverlap(minmax[0], minmax[1]);
83 83
84 if (gauge == null) { 84 if (gauge == null) {
85 return error("no gauge found."); 85 return error("no gauge found.");
86 } 86 }
87 87

http://dive4elements.wald.intevation.org