changeset 8451:e3e5d6bb4902

(issue1733) Use rangeaccess to access range information in location select RangeAccess and RiverUtils sort the locations properly.
author Andre Heinecke <andre.heinecke@intevation.de>
date Tue, 28 Oct 2014 16:10:42 +0100
parents e304f947c5a1
children b9a8463ac636
files artifacts/src/main/java/org/dive4elements/river/artifacts/states/LocationDistanceSelect.java
diffstat 1 files changed, 4 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/LocationDistanceSelect.java	Tue Oct 28 11:31:33 2014 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/LocationDistanceSelect.java	Tue Oct 28 16:10:42 2014 +0100
@@ -19,6 +19,8 @@
 import org.dive4elements.river.artifacts.D4EArtifact;
 import org.dive4elements.river.artifacts.WINFOArtifact;
 
+import org.dive4elements.river.artifacts.access.RangeAccess;
+
 
 /**
  * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
@@ -134,27 +136,8 @@
 
 
     public static double[] getLocations(WINFOArtifact flys) {
-        StateData data  = flys.getData(LOCATIONS);
-        String    value = data != null ? (String) data.getValue() : null;
-
-        if (value == null || value.length() == 0) {
-            log.warn("No location data given.");
-            return null;
-        }
-
-        String[]         splitted = value.split(" ");
-        TDoubleArrayList values   = new TDoubleArrayList();
-
-        for (String split: splitted) {
-            try {
-                values.add(Double.valueOf(split));
-            }
-            catch (NumberFormatException nfe) {
-                log.warn(nfe, nfe);
-            }
-        }
-
-        return values.toNativeArray();
+        RangeAccess ra = new RangeAccess(flys);
+        return ra.getLocations();
     }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org