comparison artifacts/src/main/java/org/dive4elements/river/artifacts/access/ComputationRangeAccess.java @ 9132:8cc192731c7d

WQSelect can now handle distance-only data
author gernotbelger
date Wed, 06 Jun 2018 14:24:51 +0200
parents e3519c3e7a0a
children
comparison
equal deleted inserted replaced
9131:0a19a79663dd 9132:8cc192731c7d
52 nfe.printStackTrace(); 52 nfe.printStackTrace();
53 return null; 53 return null;
54 } 54 }
55 } 55 }
56 56
57 public final double getStartKm() {
58
59 final KM_MODE mode = getKmRangeMode();
60 switch (mode) {
61 case RANGE:
62 case DISTANCE_ONLY:
63 return getFrom();
64
65 case LOCATIONS:
66 case NONE:
67 default:
68 final double[] locations = getLocations();
69 if( locations != null && locations.length > 0 )
70 // TODO: this is the old behaviour, but what happens if the user enters the values unsorted?
71 return locations[0];
72
73 return Double.NaN;
74 }
75 }
76
57 public double[] getKms() { 77 public double[] getKms() {
58 78
59 if (isRange()) 79 if (isRange())
60 return getKmSteps(); 80 return getKmSteps();
61 81

http://dive4elements.wald.intevation.org