Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/RiverAxisState.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 | adb52a2005e7 |
children | fbe18ad4caff |
comparison
equal
deleted
inserted
replaced
1143:eed81499b0d2 | 1144:c07e9e9c7482 |
---|---|
9 | 9 |
10 import de.intevation.artifacts.CallContext; | 10 import de.intevation.artifacts.CallContext; |
11 import de.intevation.artifacts.CallMeta; | 11 import de.intevation.artifacts.CallMeta; |
12 | 12 |
13 import de.intevation.artifactdatabase.state.Facet; | 13 import de.intevation.artifactdatabase.state.Facet; |
14 | |
15 import de.intevation.flys.model.RiverAxis; | |
16 | 14 |
17 import de.intevation.flys.artifacts.FLYSArtifact; | 15 import de.intevation.flys.artifacts.FLYSArtifact; |
18 import de.intevation.flys.artifacts.context.FLYSContext; | 16 import de.intevation.flys.artifacts.context.FLYSContext; |
19 import de.intevation.flys.artifacts.model.WMSLayerFacet; | 17 import de.intevation.flys.artifacts.model.WMSLayerFacet; |
20 import de.intevation.flys.artifacts.resources.Resources; | 18 import de.intevation.flys.artifacts.resources.Resources; |
73 ComputeType.INIT, | 71 ComputeType.INIT, |
74 getID(), hash, | 72 getID(), hash, |
75 url); | 73 url); |
76 | 74 |
77 facet.addLayer(WMS_LAYER_NAME); | 75 facet.addLayer(WMS_LAYER_NAME); |
78 | 76 facet.setExtent(GeometryUtils.getRiverBounds(river)); |
79 RiverAxis axis = RiverAxis.getRiverAxis(river); | |
80 if (axis != null) { | |
81 // TODO Take the correct EPSG into account. Maybe, we need to | |
82 // reproject the geometry. | |
83 Geometry geom = axis.getGeom().getBoundary(); | |
84 String bounds = GeometryUtils.jtsBoundsToOLBounds(geom); | |
85 | |
86 logger.debug("River '" + river + "' bounds: " + bounds); | |
87 | |
88 facet.setExtent(bounds); | |
89 } | |
90 | |
91 facet.setSrid(FLYSUtils.getRiverSrid(artifact)); | 77 facet.setSrid(FLYSUtils.getRiverSrid(artifact)); |
92 | 78 |
93 facets.add(facet); | 79 facets.add(facet); |
94 | 80 |
95 return null; | 81 return null; |