annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSGaugeLocationArtifact.java @ 4137:9be8d7942284

Open gauge and river info in a new browser window Fix for issue #918
author Björn Ricks <bjoern.ricks@intevation.de>
date Mon, 15 Oct 2012 15:23:13 +0200
parents 2fdbe78a8fc2
children a2735a4bf75e
rev   line source
2684
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.artifacts;
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
2
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
3 import java.util.List;
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
4
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
5 import org.w3c.dom.Document;
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
6
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
7 import org.apache.log4j.Logger;
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
8
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
9 import com.vividsolutions.jts.geom.Envelope;
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
10 import com.vividsolutions.jts.geom.Geometry;
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
11
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
12 import de.intevation.artifacts.ArtifactFactory;
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
13 import de.intevation.artifacts.CallMeta;
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
14
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
15 import de.intevation.artifactdatabase.state.Facet;
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
16 import de.intevation.artifactdatabase.state.DefaultOutput;
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
17 import de.intevation.artifactdatabase.state.State;
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
18
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
19 import de.intevation.flys.model.River;
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
20 import de.intevation.flys.model.GaugeLocation;
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
21
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
22 import de.intevation.flys.artifacts.WMSDBArtifact.WMSDBState;
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
23 import de.intevation.flys.artifacts.model.FacetTypes;
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
24 import de.intevation.flys.artifacts.model.RiverFactory;
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
25 import de.intevation.flys.utils.FLYSUtils;
3301
c8f670ae96e8 Create extent of a map layer in the correct coordinate reference system.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2699
diff changeset
26 import de.intevation.flys.utils.GeometryUtils;
2684
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
27
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
28
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
29 public class WMSGaugeLocationArtifact extends WMSDBArtifact {
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
30
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
31 public static final String NAME = "wmsgaugelocation";
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
32
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
33
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
34 private static final Logger logger =
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
35 Logger.getLogger(WMSGaugeLocationArtifact.class);
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
36
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
37
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
38 @Override
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
39 public void setup(
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
40 String identifier,
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
41 ArtifactFactory factory,
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
42 Object context,
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
43 CallMeta callMeta,
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
44 Document data)
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
45 {
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
46 logger.debug("WMSGaugeLocationArtifact.setup");
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
47
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
48 super.setup(identifier, factory, context, callMeta, data);
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
49 }
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
50
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
51
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
52 @Override
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
53 public String getName() {
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
54 return NAME;
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
55 }
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
56
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
57
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
58 @Override
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
59 public State getCurrentState(Object cc) {
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
60 State s = new WMSGaugeLocationState(this);
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
61
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
62 List<Facet> fs = facets.get(getCurrentStateId());
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
63
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
64 DefaultOutput o = new DefaultOutput(
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
65 "floodmap",
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
66 "floodmap",
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
67 "image/png",
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
68 fs,
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
69 "map");
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
70
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
71 s.getOutputs().add(o);
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
72
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
73 return s;
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
74 }
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
75
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
76
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
77
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
78 public static class WMSGaugeLocationState extends WMSDBState implements FacetTypes {
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
79
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
80 private static final Logger logger =
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
81 Logger.getLogger(WMSGaugeLocationState.class);
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
82
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
83 protected Geometry geom;
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
84
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
85 public WMSGaugeLocationState(WMSDBArtifact artifact) {
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
86 super(artifact);
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
87 }
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
88
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
89 @Override
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
90 protected String getFacetType() {
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
91 return FLOODMAP_GAUGE_LOCATION;
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
92 }
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
93
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
94 @Override
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
95 protected String getUrl() {
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
96 return FLYSUtils.getUserWMSUrl(artifact.identifier());
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
97 }
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
98
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
99 @Override
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
100 protected String getSrid() {
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
101 River river = RiverFactory.getRiver(getRiverId());
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
102 return FLYSUtils.getRiverSrid(river.getName());
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
103 }
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
104
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
105 @Override
3918
2fdbe78a8fc2 Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3301
diff changeset
106 protected Envelope getExtent(boolean reproject) {
2684
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
107 List<GaugeLocation> gauges =
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
108 GaugeLocation.getGaugeLocations(getRiverId(), getName());
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
109
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
110 Envelope max = null;
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
111
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
112 for (GaugeLocation gauge: gauges) {
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
113 Envelope env = gauge.getGeom().getEnvelopeInternal();
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
114
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
115 if (max == null) {
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
116 max = env;
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
117 continue;
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
118 }
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
119
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
120 max.expandToInclude(env);
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
121 }
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
122
3918
2fdbe78a8fc2 Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3301
diff changeset
123 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
124 ? 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
125 : max;
2684
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
126 }
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
127
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
128 @Override
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
129 protected String getFilter() {
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
130 return "river_id=" + String.valueOf(getRiverId()) +
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
131 " and name='" + getName() + "'";
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
132 }
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
133
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
134 @Override
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
135 protected String getDataString() {
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
136 String srid = getSrid();
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
137
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
138 if (FLYSUtils.isUsingOracle()) {
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
139 return "geom FROM gauge_location USING SRID " + srid;
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
140 }
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
141 else {
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
142 return "geom FROM gauge_location " +
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
143 "USING UNIQUE id USING SRID " + srid;
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
144 }
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
145 }
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
146
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
147 @Override
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
148 protected String getGeometryType() {
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
149 return "POINT";
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
150 }
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
151 }
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
152 }
14188f8daefb Added support for WMS gauges in floodmaps and maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
153 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org