annotate artifacts/src/main/java/org/dive4elements/river/artifacts/WMSHydrBoundaryPolyArtifact.java @ 9801:1d7a72a50183 3.2.x tip

Assume Compose V2, consistently
author Tom Gottfried <tom@intevation.de>
date Thu, 23 Nov 2023 10:14:13 +0100
parents a41f9c355204
children
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
9726
0a5239a1e46e Upgrade to Log4j 2
Tom Gottfried <tom@intevation.de>
parents: 8856
diff changeset
13 import org.apache.logging.log4j.Logger;
0a5239a1e46e Upgrade to Log4j 2
Tom Gottfried <tom@intevation.de>
parents: 8856
diff changeset
14 import org.apache.logging.log4j.LogManager;
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
15
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 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
17
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5515
diff changeset
18 import org.dive4elements.artifactdatabase.state.DefaultOutput;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5515
diff changeset
19 import org.dive4elements.artifactdatabase.state.Facet;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5515
diff changeset
20 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
21
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5515
diff changeset
22 import org.dive4elements.river.model.River;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5515
diff changeset
23 import org.dive4elements.river.model.HydrBoundaryPoly;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5515
diff changeset
24
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5515
diff changeset
25 import org.dive4elements.river.artifacts.model.FacetTypes;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5515
diff changeset
26 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
27 import org.dive4elements.river.utils.RiverUtils;
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5515
diff changeset
28 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
29
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
30
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
31 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
32
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 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
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
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7842
diff changeset
36 private static final Logger log =
9726
0a5239a1e46e Upgrade to Log4j 2
Tom Gottfried <tom@intevation.de>
parents: 8856
diff changeset
37 LogManager.getLogger(WMSHydrBoundaryPolyArtifact.class);
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
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 @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
41 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
42 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
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
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
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 @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
47 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
48 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
49
4497
a2735a4bf75e Change facets member variable to private
Björn Ricks <bjoern.ricks@intevation.de>
parents: 3918
diff changeset
50 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
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 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
53 "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
54 "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
55 "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
56 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
57 "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
58
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 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
60
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 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
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
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
65 public static class HydrBoundaryPolyState
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
66 extends WMSDBState implements FacetTypes
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
67 {
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7842
diff changeset
68 private static final Logger log =
9726
0a5239a1e46e Upgrade to Log4j 2
Tom Gottfried <tom@intevation.de>
parents: 8856
diff changeset
69 LogManager.getLogger(HydrBoundaryPolyState.class);
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
70
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 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
72
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 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
74 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
75 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
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
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 @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
79 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
80 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
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 @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
84 protected String getUrl() {
9752
a41f9c355204 Remove unused parameter
Tom Gottfried <tom@intevation.de>
parents: 9726
diff changeset
85 return RiverUtils.getUserWMSUrl();
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
86 }
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 @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
89 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
90 River river = RiverFactory.getRiver(getRiverId());
5865
73da40528cf2 River artifacts: Renamed FLYSUtils to RiverUtils.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
91 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
92 }
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 @Override
3918
2fdbe78a8fc2 Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3301
diff changeset
95 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
96 String kind = getIdPart(2);
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
97 String sectie = getIdPart(3);
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
98 String sobek = getIdPart(4);
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
99 int kindId = -1;
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
100 int sectieId = -1;
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
101 int sobekId = -1;
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
102
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
103 if (kind != null) {
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
104 kindId = Integer.parseInt(kind);
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
105 }
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
106 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
107 sectieId = Integer.parseInt(sectie);
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
108 }
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
109 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
110 sobekId = Integer.parseInt(sobek);
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
111 }
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
112
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
113 List<HydrBoundaryPoly> boundaries;
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
114 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
115 boundaries = HydrBoundaryPoly.getHydrBoundaries(
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
116 getRiverId(), getName());
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
117 } else {
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
118 boundaries = HydrBoundaryPoly.getHydrBoundaries(
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
119 getRiverId(), kindId, sectieId, sobekId);
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
120 }
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
121
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
122 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
123
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
124 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
125 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
126
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
127 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
128 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
129 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
130 }
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
131
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
132 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
133 }
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
134
3918
2fdbe78a8fc2 Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3301
diff changeset
135 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
136 ? 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
137 : 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
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
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 @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
141 protected String getFilter() {
5515
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
142 // Expected id string:
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
143 // 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
144 String kind = getIdPart(2);
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
145 String sectie = getIdPart(3);
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
146 String sobek = getIdPart(4);
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
147
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
148 String filter = "";
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
149 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
150 filter += " AND kind = " + kind;
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
151 }
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
152 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
153 filter += " AND sectie = " + sectie;
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
154 }
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
155 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
156 filter += " AND sobek = " + sobek;
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
157 }
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
158
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
159 if (filter.isEmpty()) {
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
160 filter = " AND name='" + getName() + "'";
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
161 }
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
162
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
163 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
164 + 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
165 }
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
166
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
167 @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
168 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
169 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
170
5865
73da40528cf2 River artifacts: Renamed FLYSUtils to RiverUtils.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
171 if (RiverUtils.isUsingOracle()) {
5515
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
172 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
173 }
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
174 else {
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
175 return "geom FROM hydr_boundaries_poly "
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
176 + "USING UNIQUE id USING SRID "
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
177 + 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
178 }
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
179 }
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
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
181 @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
182 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
183 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
184 }
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 } // 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
186 }
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 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org