annotate artifacts/src/main/java/org/dive4elements/river/artifacts/WMSHydrBoundaryPolyArtifact.java @ 7167:2fd238b681a9

Add debug output triggered by debugging the last commit
author Andre Heinecke <aheinecke@intevation.de>
date Thu, 26 Sep 2013 12:22:01 +0200
parents af13ceeba52a
children 8d5ca5175038
rev   line source
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
2 * Software engineering by Intevation GmbH
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
3 *
5994
af13ceeba52a Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5865
diff changeset
4 * This file is Free Software under the GNU AGPL (>=v3)
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the
5994
af13ceeba52a Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5865
diff changeset
6 * documentation coming with Dive4Elements River for details.
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
7 */
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
8
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5515
diff changeset
9 package org.dive4elements.river.artifacts;
2683
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
10
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
11 import java.util.List;
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
12
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
13 import org.w3c.dom.Document;
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
14
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
15 import org.apache.log4j.Logger;
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
16
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
17 import com.vividsolutions.jts.geom.Envelope;
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
18
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5515
diff changeset
19 import org.dive4elements.artifacts.ArtifactFactory;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5515
diff changeset
20 import org.dive4elements.artifacts.CallMeta;
2683
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
21
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5515
diff changeset
22 import org.dive4elements.artifactdatabase.state.DefaultOutput;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5515
diff changeset
23 import org.dive4elements.artifactdatabase.state.Facet;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5515
diff changeset
24 import org.dive4elements.artifactdatabase.state.State;
2683
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
25
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5515
diff changeset
26 import org.dive4elements.river.model.River;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5515
diff changeset
27 import org.dive4elements.river.model.HydrBoundaryPoly;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5515
diff changeset
28
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5515
diff changeset
29 import org.dive4elements.river.artifacts.model.FacetTypes;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5515
diff changeset
30 import org.dive4elements.river.artifacts.model.RiverFactory;
5865
73da40528cf2 River artifacts: Renamed FLYSUtils to RiverUtils.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
31 import org.dive4elements.river.utils.RiverUtils;
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5515
diff changeset
32 import org.dive4elements.river.utils.GeometryUtils;
2683
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
33
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
34
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
35 public class WMSHydrBoundaryPolyArtifact extends WMSDBArtifact {
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
36
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
37 public static final String NAME = "hydr_boundary_poly";
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
38
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
39
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
40 private static final Logger logger =
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
41 Logger.getLogger(WMSHydrBoundaryPolyArtifact.class);
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
42
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
43
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
44 @Override
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
45 public void setup(
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
46 String identifier,
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
47 ArtifactFactory factory,
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
48 Object context,
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
49 CallMeta callMeta,
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
50 Document data)
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
51 {
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
52 logger.debug("WMSHydrBoundaryArtifact.setup");
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
53
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
54 super.setup(identifier, factory, context, callMeta, data);
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
55 }
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
56
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
57
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
58 @Override
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
59 public String getName() {
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
60 return NAME;
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
61 }
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
62
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
63
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
64 @Override
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
65 public State getCurrentState(Object cc) {
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
66 State s = new HydrBoundaryPolyState(this);
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
67
4497
a2735a4bf75e Change facets member variable to private
Björn Ricks <bjoern.ricks@intevation.de>
parents: 3918
diff changeset
68 List<Facet> fs = getFacets(getCurrentStateId());
2683
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
69
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
70 DefaultOutput o = new DefaultOutput(
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
71 "floodmap",
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
72 "floodmap",
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
73 "image/png",
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
74 fs,
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
75 "map");
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
76
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
77 s.getOutputs().add(o);
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
78
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
79 return s;
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
80 }
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
81
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
82
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
83 public static class HydrBoundaryPolyState extends WMSDBState implements FacetTypes
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
84 {
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
85 private static final Logger logger =
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
86 Logger.getLogger(HydrBoundaryPolyState.class);
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
87
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
88 protected int riverId;
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
89
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
90 public HydrBoundaryPolyState(WMSDBArtifact artifact) {
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
91 super(artifact);
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
92 riverId = 0;
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
93 }
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
94
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
95 @Override
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
96 protected String getFacetType() {
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
97 return FLOODMAP_HYDR_BOUNDARY_POLY;
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
98 }
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
99
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
100 @Override
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
101 protected String getUrl() {
5865
73da40528cf2 River artifacts: Renamed FLYSUtils to RiverUtils.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
102 return RiverUtils.getUserWMSUrl(artifact.identifier());
2683
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
103 }
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
104
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
105 @Override
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
106 protected String getSrid() {
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
107 River river = RiverFactory.getRiver(getRiverId());
5865
73da40528cf2 River artifacts: Renamed FLYSUtils to RiverUtils.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
108 return RiverUtils.getRiverSrid(river.getName());
2683
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
109 }
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
110
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
111 @Override
3918
2fdbe78a8fc2 Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3301
diff changeset
112 protected Envelope getExtent(boolean reproject) {
5515
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
113 String kind = getIdPart(2);
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
114 String sectie = getIdPart(3);
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
115 String sobek = getIdPart(4);
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
116 int kindId = -1;
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
117 int sectieId = -1;
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
118 int sobekId = -1;
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
119
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
120 if (kind != null) {
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
121 kindId = Integer.parseInt(kind);
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
122 }
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
123 if (sectie != null && !sectie.equals("-1")) {
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
124 sectieId = Integer.parseInt(sectie);
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
125 }
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
126 if (sobek != null && !sobek.equals("-1")) {
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
127 sobekId = Integer.parseInt(sobek);
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
128 }
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
129
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
130 List<HydrBoundaryPoly> boundaries;
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
131 if (kindId == -1 && sobekId == -1 && sectieId == -1) {
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
132 boundaries = HydrBoundaryPoly.getHydrBoundaries(
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
133 getRiverId(), getName());
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
134 } else {
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
135 boundaries = HydrBoundaryPoly.getHydrBoundaries(
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
136 getRiverId(), kindId, sectieId, sobekId);
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
137 }
2683
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
138
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
139 Envelope max = null;
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
140
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
141 for (HydrBoundaryPoly b: boundaries) {
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
142 Envelope env = b.getGeom().getEnvelopeInternal();
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
143
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
144 if (max == null) {
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
145 max = env;
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
146 continue;
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
147 }
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
148
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
149 max.expandToInclude(env);
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
150 }
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
151
3918
2fdbe78a8fc2 Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3301
diff changeset
152 return max != null && reproject
3301
c8f670ae96e8 Create extent of a map layer in the correct coordinate reference system.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2699
diff changeset
153 ? GeometryUtils.transform(max, getSrid())
c8f670ae96e8 Create extent of a map layer in the correct coordinate reference system.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2699
diff changeset
154 : max;
2683
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
155 }
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
156
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
157 @Override
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
158 protected String getFilter() {
5515
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
159 // Expected id string:
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
160 // river_id;layer_name;kind;sectie;sobek
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
161 String kind = getIdPart(2);
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
162 String sectie = getIdPart(3);
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
163 String sobek = getIdPart(4);
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
164
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
165 String filter = "";
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
166 if (kind != null && !kind.equals("-1")) {
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
167 filter += " AND kind = " + kind;
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
168 }
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
169 if (sectie != null && !sectie.equals("-1")) {
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
170 filter += " AND sectie = " + sectie;
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
171 }
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
172 if (sobek != null && !sobek.equals("-1")) {
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
173 filter += " AND sobek = " + sobek;
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
174 }
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
175
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
176 if (filter.isEmpty()) {
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
177 filter = " AND name='" + getName() + "'";
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
178 }
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
179
2683
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
180 return "river_id=" + String.valueOf(getRiverId())
5515
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
181 + filter;
2683
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
182 }
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
183
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
184 @Override
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
185 protected String getDataString() {
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
186 String srid = getSrid();
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
187
5865
73da40528cf2 River artifacts: Renamed FLYSUtils to RiverUtils.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
188 if (RiverUtils.isUsingOracle()) {
5515
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
189 return "geom FROM hydr_boundaries_poly USING SRID " + srid;
2683
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
190 }
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
191 else {
5515
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
192 return "geom FROM hydr_boundaries_poly USING UNIQUE id USING SRID " + srid;
2683
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
193 }
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
194 }
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
195
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
196 @Override
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
197 protected String getGeometryType() {
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
198 return "POLYGON";
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
199 }
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
200 } // end of HydrBoundaryState
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
201 }
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
202 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org