Mercurial > dive4elements > river
diff flys-artifacts/src/main/java/de/intevation/flys/utils/GeometryUtils.java @ 1144:c07e9e9c7482
Set the river extent for WMSLayers in the FloodMapState.
flys-artifacts/trunk@2667 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 07 Sep 2011 13:54:18 +0000 |
parents | 66783d957201 |
children | 0398c2b8dbaf |
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/utils/GeometryUtils.java Wed Sep 07 11:50:10 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/utils/GeometryUtils.java Wed Sep 07 13:54:18 2011 +0000 @@ -32,6 +32,8 @@ import org.geotools.geojson.feature.FeatureJSON; import org.geotools.referencing.CRS; +import de.intevation.flys.model.RiverAxis; + public class GeometryUtils { @@ -42,6 +44,19 @@ } + public static String getRiverBounds(String rivername) { + RiverAxis axis = RiverAxis.getRiverAxis(rivername); + if (axis != null) { + // TODO Take the correct EPSG into account. Maybe, we need to + // reproject the geometry. + Geometry geom = axis.getGeom().getBoundary(); + return jtsBoundsToOLBounds(geom); + } + + return null; + } + + /** * Returns the boundary of Geometry <i>geom</i> in OpenLayers * representation.