diff artifacts/src/main/java/org/dive4elements/river/utils/GeometryUtils.java @ 8747:e9d912c97fa8

We expect that every river has only one RiverAxis of kind 1 This allowed to reduce code duplication and some cleanups.
author Tom Gottfried <tom@intevation.de>
date Fri, 05 Jun 2015 16:56:47 +0200
parents e4606eae8ea5
children 5e38e2924c07
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/utils/GeometryUtils.java	Fri Jun 05 16:53:07 2015 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/utils/GeometryUtils.java	Fri Jun 05 16:56:47 2015 +0200
@@ -60,24 +60,9 @@
 
     public static Envelope getRiverBoundary(String rivername) {
         try {
-            List<RiverAxis> axes = RiverAxis.getRiverAxis(rivername);
-            if (axes != null && axes.size() > 0) {
-                Envelope max = null;
-
-                for (RiverAxis axis: axes) {
-                    // TODO Take the correct EPSG into account. Maybe, we need to
-                    // reproject the geometry.
-                    Envelope env = axis.getGeom().getEnvelopeInternal();
-
-                    if (max == null) {
-                        max = env;
-                    }
-                    else {
-                        max.expandToInclude(env);
-                    }
-                }
-
-                return max;
+            RiverAxis axis = RiverAxis.getRiverAxis(rivername);
+            if (axis != null) {
+                return axis.getGeom().getEnvelopeInternal();
             }
         }
         catch(HibernateException iae) {

http://dive4elements.wald.intevation.org