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