changeset 4862:b99656db18de

FLYSUtils: Use RangeAcces, removed getKmRange.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 23 Jan 2013 13:06:29 +0100
parents aae2b7492c1e
children f2e7f07f608d
files flys-artifacts/src/main/java/de/intevation/flys/utils/FLYSUtils.java
diffstat 1 files changed, 4 insertions(+), 37 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/utils/FLYSUtils.java	Wed Jan 23 13:05:36 2013 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/utils/FLYSUtils.java	Wed Jan 23 13:06:29 2013 +0100
@@ -219,41 +219,6 @@
         }
     }
 
-    // TODO Moved to RangeAccess. Resolve remaining calls.
-    private static RangeAccess.KM_MODE getKmRangeMode(FLYSArtifact flys) {
-        RangeAccess rangeAccess = new RangeAccess(flys, null);
-        return rangeAccess.getKmRangeMode();
-    }
-
-    /**
-     * Get min and max kilometer, independent of parametization
-     * (ld_from/to vs ld_locations).
-     */
-    public static double[] getKmRange(FLYSArtifact flys) {
-        switch (getKmRangeMode(flys)) {
-            case RANGE: {
-                return getKmFromTo(flys);
-            }
-
-            case LOCATIONS: {
-                double[] locs = getLocations(flys);
-                return new double[] { locs[0], locs[locs.length-1] };
-            }
-
-            case NONE: {
-                double[] locs = getLocations(flys);
-                if (locs != null) {
-                    return new double[] { locs[0], locs[locs.length-1] };
-                }
-                else {
-                    return getKmFromTo(flys);
-                }
-            }
-        }
-
-        return new double[] { Double.NaN, Double.NaN };
-    }
-
 
     /**
      * Get bounds for river of artifact.
@@ -464,7 +429,8 @@
             return null;
         }
 
-        double[] dist  = getKmRange(flys);
+        RangeAccess rangeAccess = new RangeAccess(flys, null);
+        double[] dist = rangeAccess.getKmRange();
 
         if (dist == null) {
             logger.debug("no range found");
@@ -911,7 +877,8 @@
             return null;
         }
 
-        double [] dist = getKmRange(flys);
+        RangeAccess rangeAccess = new RangeAccess(flys, null);
+        double[] dist = rangeAccess.getKmRange();
         if (dist == null) {
             logger.debug("getGauges: no dist!");
             return null;

http://dive4elements.wald.intevation.org