diff artifacts/src/main/java/org/dive4elements/river/artifacts/WINFOArtifact.java @ 8562:c62837ba37f3

(issue1755) Move KM Step handling from Winfo artifact to RangeAccess
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 16 Feb 2015 15:58:52 +0100
parents 27d42c9ee367
children ea17665c5aad
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/WINFOArtifact.java	Mon Feb 16 12:12:12 2015 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/WINFOArtifact.java	Mon Feb 16 15:58:52 2015 +0100
@@ -85,9 +85,6 @@
      * range. */
     public static final int DEFAULT_Q_STEPS = 30;
 
-    /** The default step width between the start end end kilometer. */
-    public static final double DEFAULT_KM_STEPS = 0.1;
-
     private static final String [] INACTIVES = new String[] {
         LONGITUDINAL_Q,
         DURATION_Q,
@@ -823,42 +820,12 @@
     /**
      * Returns the selected Kms.
      *
-     * @param distance An 2dim array with [lower, upper] values.
-     *
-     * @return the selected Kms.
-     */
-    public double[] getKms(double[] distance) {
-        StateData dStep = getData("ld_step");
-
-        if (dStep == null) {
-            log.warn("No step width given. Cannot compute Kms.");
-            return null;
-        }
-
-        double step = Double.parseDouble((String) dStep.getValue());
-
-        // transform step from 'm' into 'km'
-        step = step / 1000;
-
-        if (step == 0d) {
-            step = DEFAULT_KM_STEPS;
-        }
-
-        return DoubleUtil.explode(distance[0], distance[1], step);
-    }
-
-
-    /**
-     * Returns the selected Kms.
-     *
      * @return the selected kms.
      */
     public double[] getKms() {
         if (isRange()) {
             RangeAccess rangeAccess = new RangeAccess(this);
-            double [] distance = rangeAccess.getKmRange();
-            return getKms(distance);
-
+            return rangeAccess.getKmSteps();
         }
         else {
             return LocationDistanceSelect.getLocations(this);

http://dive4elements.wald.intevation.org