Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/exports/process/FixWQProcessor.java @ 8472:3f505fba522f
(issue1772) Use 0.001km tolarance instead of 0.1 to find matching km.
There is no sense to use a define here. I will not write
static final double NULLPOINTNULLNULLONE=0.001 if i just want to use that
value and not any other value which may make sense in some other place.
Using hardcoded values can have its merits and makes the code easier to
read.
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Tue, 18 Nov 2014 15:24:40 +0100 |
parents | 6b12045ac372 |
children | 07df414d5d88 |
comparison
equal
deleted
inserted
replaced
8471:a846a3d910a0 | 8472:3f505fba522f |
---|---|
450 return; | 450 return; |
451 } | 451 } |
452 | 452 |
453 double[] kms = wqkms.getKms(); | 453 double[] kms = wqkms.getKms(); |
454 for (int i = 0 ; i< kms.length; i++) { | 454 for (int i = 0 ; i< kms.length; i++) { |
455 if (Math.abs(kms[i] - ckm) <= GAUGE_EPSILON) { | 455 /* We use a tolerance of 1m here to find a hit. |
456 * Probably to avoid some rounding errors. */ | |
457 if (Math.abs(kms[i] - ckm) <= 0.001) { | |
456 series.add(wqkms.getQ(i), wqkms.getW(i), false); | 458 series.add(wqkms.getQ(i), wqkms.getW(i), false); |
457 generator.addAxisSeries(series, axisName, visible); | 459 generator.addAxisSeries(series, axisName, visible); |
458 if(visible && theme.parseShowPointLabel()) { | 460 if(visible && theme.parseShowPointLabel()) { |
459 List<XYTextAnnotation> textAnnos = new ArrayList<XYTextAnnotation>(); | 461 List<XYTextAnnotation> textAnnos = new ArrayList<XYTextAnnotation>(); |
460 XYTextAnnotation anno = new CollisionFreeXYTextAnnotation( | 462 XYTextAnnotation anno = new CollisionFreeXYTextAnnotation( |