annotate artifacts/src/main/java/org/dive4elements/river/artifacts/WMSHydrBoundaryPolyArtifact.java @ 8856:5e38e2924c07 3.2.x

Fix code style.
author Tom Gottfried <tom@intevation.de>
date Thu, 18 Jan 2018 20:12:01 +0100
parents e4606eae8ea5
children 0a5239a1e46e
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.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
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 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
16
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5515
diff changeset
17 import org.dive4elements.artifactdatabase.state.DefaultOutput;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5515
diff changeset
18 import org.dive4elements.artifactdatabase.state.Facet;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5515
diff changeset
19 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
20
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5515
diff changeset
21 import org.dive4elements.river.model.River;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5515
diff changeset
22 import org.dive4elements.river.model.HydrBoundaryPoly;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5515
diff changeset
23
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5515
diff changeset
24 import org.dive4elements.river.artifacts.model.FacetTypes;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5515
diff changeset
25 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
26 import org.dive4elements.river.utils.RiverUtils;
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5515
diff changeset
27 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
28
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 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
31
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 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
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
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7842
diff changeset
35 private static final Logger log =
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
36 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
37
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 @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
40 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
41 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
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
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 @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
46 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
47 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
48
4497
a2735a4bf75e Change facets member variable to private
Björn Ricks <bjoern.ricks@intevation.de>
parents: 3918
diff changeset
49 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
50
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 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
52 "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
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 "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
55 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
56 "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
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 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
59
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 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
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
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
64 public static class HydrBoundaryPolyState
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
65 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
66 {
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7842
diff changeset
67 private static final Logger log =
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
68 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
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 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
71
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 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
73 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
74 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
75 }
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 @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
78 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
79 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
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 @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
83 protected String getUrl() {
5865
73da40528cf2 River artifacts: Renamed FLYSUtils to RiverUtils.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
84 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
85 }
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 @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
88 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
89 River river = RiverFactory.getRiver(getRiverId());
5865
73da40528cf2 River artifacts: Renamed FLYSUtils to RiverUtils.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
90 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
91 }
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 @Override
3918
2fdbe78a8fc2 Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3301
diff changeset
94 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
95 String kind = getIdPart(2);
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
96 String sectie = getIdPart(3);
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
97 String sobek = getIdPart(4);
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
98 int kindId = -1;
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
99 int sectieId = -1;
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
100 int sobekId = -1;
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
101
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
102 if (kind != null) {
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
103 kindId = Integer.parseInt(kind);
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
104 }
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
105 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
106 sectieId = Integer.parseInt(sectie);
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
107 }
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
108 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
109 sobekId = Integer.parseInt(sobek);
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
110 }
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 List<HydrBoundaryPoly> boundaries;
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
113 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
114 boundaries = HydrBoundaryPoly.getHydrBoundaries(
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
115 getRiverId(), getName());
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
116 } else {
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
117 boundaries = HydrBoundaryPoly.getHydrBoundaries(
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
118 getRiverId(), kindId, sectieId, sobekId);
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
119 }
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
120
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 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
122
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 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
124 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
125
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 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
127 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
128 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
129 }
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 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
132 }
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
3918
2fdbe78a8fc2 Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3301
diff changeset
134 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
135 ? 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
136 : 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
137 }
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 @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
140 protected String getFilter() {
5515
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
141 // Expected id string:
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
142 // 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
143 String kind = getIdPart(2);
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
144 String sectie = getIdPart(3);
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
145 String sobek = getIdPart(4);
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
146
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
147 String filter = "";
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
148 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
149 filter += " AND kind = " + kind;
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
150 }
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
151 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
152 filter += " AND sectie = " + sectie;
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
153 }
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
154 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
155 filter += " AND sobek = " + sobek;
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
156 }
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 if (filter.isEmpty()) {
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
159 filter = " AND name='" + getName() + "'";
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
160 }
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
161
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
162 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
163 + 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
164 }
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 @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
167 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
168 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
169
5865
73da40528cf2 River artifacts: Renamed FLYSUtils to RiverUtils.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
170 if (RiverUtils.isUsingOracle()) {
5515
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
171 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
172 }
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 else {
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
174 return "geom FROM hydr_boundaries_poly "
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
175 + "USING UNIQUE id USING SRID "
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
176 + 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
177 }
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 @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
181 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
182 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
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 } // 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
185 }
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 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org