annotate artifacts/src/main/java/org/dive4elements/river/artifacts/WMSHydrBoundaryPolyArtifact.java @ 8202:e4606eae8ea5

sed src/**/*.java 's/logger/log/g'
author Sascha L. Teichmann <teichmann@intevation.de>
date Fri, 05 Sep 2014 12:58:17 +0200
parents 8d5ca5175038
children 5e38e2924c07
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
f5af3adb3b95 Improved datacage configuration 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 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
65 {
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7842
diff changeset
66 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
67 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
68
f5af3adb3b95 Improved datacage configuration 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 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
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 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
72 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
73 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
74 }
f5af3adb3b95 Improved datacage configuration 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 @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
77 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
78 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
79 }
f5af3adb3b95 Improved datacage configuration 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 @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
82 protected String getUrl() {
5865
73da40528cf2 River artifacts: Renamed FLYSUtils to RiverUtils.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
83 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
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
f5af3adb3b95 Improved datacage configuration 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 @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
87 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
88 River river = RiverFactory.getRiver(getRiverId());
5865
73da40528cf2 River artifacts: Renamed FLYSUtils to RiverUtils.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
89 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
90 }
f5af3adb3b95 Improved datacage configuration 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 @Override
3918
2fdbe78a8fc2 Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3301
diff changeset
93 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
94 String kind = getIdPart(2);
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
95 String sectie = getIdPart(3);
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
96 String sobek = getIdPart(4);
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
97 int kindId = -1;
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
98 int sectieId = -1;
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
99 int sobekId = -1;
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
100
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
101 if (kind != null) {
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
102 kindId = Integer.parseInt(kind);
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
103 }
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
104 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
105 sectieId = Integer.parseInt(sectie);
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
106 }
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
107 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
108 sobekId = Integer.parseInt(sobek);
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
109 }
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 List<HydrBoundaryPoly> boundaries;
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
112 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
113 boundaries = HydrBoundaryPoly.getHydrBoundaries(
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
114 getRiverId(), getName());
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
115 } else {
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
116 boundaries = HydrBoundaryPoly.getHydrBoundaries(
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
117 getRiverId(), kindId, sectieId, sobekId);
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
118 }
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
119
f5af3adb3b95 Improved datacage configuration 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 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
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 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
123 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
124
f5af3adb3b95 Improved datacage configuration 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 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
126 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
127 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
128 }
f5af3adb3b95 Improved datacage configuration 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 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
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
3918
2fdbe78a8fc2 Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3301
diff changeset
133 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
134 ? 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
135 : 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
136 }
f5af3adb3b95 Improved datacage configuration 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 @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
139 protected String getFilter() {
5515
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
140 // Expected id string:
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
141 // 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
142 String kind = getIdPart(2);
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
143 String sectie = getIdPart(3);
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
144 String sobek = getIdPart(4);
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
145
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
146 String filter = "";
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
147 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
148 filter += " AND kind = " + kind;
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
149 }
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
150 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
151 filter += " AND sectie = " + sectie;
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
152 }
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
153 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
154 filter += " AND sobek = " + sobek;
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
155 }
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 if (filter.isEmpty()) {
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
158 filter = " AND name='" + getName() + "'";
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
159 }
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
160
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
161 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
162 + 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
163 }
f5af3adb3b95 Improved datacage configuration 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 @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
166 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
167 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
168
5865
73da40528cf2 River artifacts: Renamed FLYSUtils to RiverUtils.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
169 if (RiverUtils.isUsingOracle()) {
5515
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
170 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
171 }
f5af3adb3b95 Improved datacage configuration 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 else {
5515
87dab419b924 Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents: 4497
diff changeset
173 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
174 }
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
175 }
f5af3adb3b95 Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
176
f5af3adb3b95 Improved datacage configuration 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 @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
178 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
179 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
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 } // 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
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 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org