Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/utils/GeometryUtils.java @ 1052:eeebf8514c7f
The boundary (extent) for the river axis is determined based on its geometry - this extent is written into the wms facet.
flys-artifacts/trunk@2514 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Fri, 19 Aug 2011 15:52:03 +0000 |
parents | |
children | e9f66d63bdd0 |
comparison
equal
deleted
inserted
replaced
1051:9a77a9adbb36 | 1052:eeebf8514c7f |
---|---|
1 package de.intevation.flys.utils; | |
2 | |
3 import com.vividsolutions.jts.geom.Coordinate; | |
4 import com.vividsolutions.jts.geom.Geometry; | |
5 | |
6 | |
7 | |
8 public class GeometryUtils { | |
9 | |
10 private GeometryUtils() { | |
11 } | |
12 | |
13 | |
14 /** | |
15 * Returns the boundary of Geometry <i>geom</i> in OpenLayers | |
16 * representation. | |
17 * | |
18 * @param geom The geometry. | |
19 * | |
20 * @return the OpenLayers boundary of <i>geom</i>. | |
21 */ | |
22 public static String jtsBoundsToOLBounds(Geometry geom) { | |
23 Coordinate[] c = geom != null ? geom.getCoordinates() : null; | |
24 | |
25 if (c == null || c.length < 2) { | |
26 return null; | |
27 } | |
28 | |
29 return "" + c[0].x + " " + c[1].y + " " + c[1].x + " " + c[0].y; | |
30 } | |
31 } | |
32 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |