Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSQPSArtifact.java @ 5818:a4ff4167be1e
Request feature info on all layers and show it as html if
the server does not return valid gml.
Non queryable layers produce an error message when the request
fails. This is good enough
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Wed, 24 Apr 2013 17:33:27 +0200 |
parents | 948a106bc4cd |
children |
rev | line source |
---|---|
1836
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.artifacts; |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
3 import java.util.List; |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
4 |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
5 import org.w3c.dom.Document; |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
6 |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
7 import org.apache.log4j.Logger; |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
8 |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
9 import com.vividsolutions.jts.geom.Envelope; |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 import de.intevation.artifacts.ArtifactFactory; |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
12 import de.intevation.artifacts.CallMeta; |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
13 |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
14 import de.intevation.artifactdatabase.state.DefaultOutput; |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
15 import de.intevation.artifactdatabase.state.Facet; |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
16 import de.intevation.artifactdatabase.state.State; |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
17 |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
18 import de.intevation.flys.model.River; |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
19 import de.intevation.flys.model.CrossSectionTrack; |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
20 |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
21 import de.intevation.flys.artifacts.model.FacetTypes; |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
22 import de.intevation.flys.artifacts.model.RiverFactory; |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
23 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
|
24 import de.intevation.flys.utils.GeometryUtils; |
1836
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
25 |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
27 public class WMSQPSArtifact extends WMSDBArtifact { |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
28 |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 public static final String NAME = "qps"; |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 private static final Logger logger = |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
33 Logger.getLogger(WMSQPSArtifact.class); |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
34 |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
36 @Override |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
37 public void setup( |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
38 String identifier, |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
39 ArtifactFactory factory, |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
40 Object context, |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 CallMeta callMeta, |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
42 Document data) |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
43 { |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 logger.debug("WMSQPSArtifact.setup"); |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
45 |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 super.setup(identifier, factory, context, callMeta, data); |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 } |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 @Override |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
51 public String getName() { |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
52 return NAME; |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
53 } |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
54 |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
55 |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
56 @Override |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 public State getCurrentState(Object cc) { |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 State s = new WMSQPSState(this); |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 |
4497
a2735a4bf75e
Change facets member variable to private
Björn Ricks <bjoern.ricks@intevation.de>
parents:
3918
diff
changeset
|
60 List<Facet> fs = getFacets(getCurrentStateId()); |
1836
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
61 |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
62 DefaultOutput o = new DefaultOutput( |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 "floodmap", |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
64 "floodmap", |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
65 "image/png", |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
66 fs, |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
67 "map"); |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
68 |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
69 s.getOutputs().add(o); |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
70 |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 return s; |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
72 } |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
73 |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
74 |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
75 public static class WMSQPSState extends WMSDBState implements FacetTypes { |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
76 |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
77 private static final Logger logger = |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
78 Logger.getLogger(WMSQPSState.class); |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
79 |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
80 public WMSQPSState(WMSDBArtifact artifact) { |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
81 super(artifact); |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
82 } |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
83 |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
84 @Override |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
85 protected String getFacetType() { |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
86 return FLOODMAP_QPS; |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
87 } |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
88 |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
89 @Override |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
90 protected String getUrl() { |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
91 return FLYSUtils.getUserWMSUrl(artifact.identifier()); |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
92 } |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
93 |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
94 @Override |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
95 protected String getSrid() { |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
96 River river = RiverFactory.getRiver(getRiverId()); |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
97 return FLYSUtils.getRiverSrid(river.getName()); |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
98 } |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
99 |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
100 @Override |
3918
2fdbe78a8fc2
Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3405
diff
changeset
|
101 protected Envelope getExtent(boolean reproject) { |
1836
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
102 River river = RiverFactory.getRiver(getRiverId()); |
5469
948a106bc4cd
Handle kind filtering in QPS WMS artifact
Andre Heinecke <aheinecke@intevation.de>
parents:
5468
diff
changeset
|
103 List<CrossSectionTrack> qps; |
1836
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
104 |
5469
948a106bc4cd
Handle kind filtering in QPS WMS artifact
Andre Heinecke <aheinecke@intevation.de>
parents:
5468
diff
changeset
|
105 String kind = getIdPart(2); |
948a106bc4cd
Handle kind filtering in QPS WMS artifact
Andre Heinecke <aheinecke@intevation.de>
parents:
5468
diff
changeset
|
106 |
948a106bc4cd
Handle kind filtering in QPS WMS artifact
Andre Heinecke <aheinecke@intevation.de>
parents:
5468
diff
changeset
|
107 if (kind != null && kind.equals("1")) { |
948a106bc4cd
Handle kind filtering in QPS WMS artifact
Andre Heinecke <aheinecke@intevation.de>
parents:
5468
diff
changeset
|
108 qps = CrossSectionTrack.getCrossSectionTrack(river.getName(), |
948a106bc4cd
Handle kind filtering in QPS WMS artifact
Andre Heinecke <aheinecke@intevation.de>
parents:
5468
diff
changeset
|
109 Integer.parseInt(kind)); |
948a106bc4cd
Handle kind filtering in QPS WMS artifact
Andre Heinecke <aheinecke@intevation.de>
parents:
5468
diff
changeset
|
110 } else if (kind != null) { |
948a106bc4cd
Handle kind filtering in QPS WMS artifact
Andre Heinecke <aheinecke@intevation.de>
parents:
5468
diff
changeset
|
111 qps = CrossSectionTrack.getCrossSectionTrack(river.getName(), |
948a106bc4cd
Handle kind filtering in QPS WMS artifact
Andre Heinecke <aheinecke@intevation.de>
parents:
5468
diff
changeset
|
112 getName(), Integer.parseInt(kind)); |
948a106bc4cd
Handle kind filtering in QPS WMS artifact
Andre Heinecke <aheinecke@intevation.de>
parents:
5468
diff
changeset
|
113 } else { |
948a106bc4cd
Handle kind filtering in QPS WMS artifact
Andre Heinecke <aheinecke@intevation.de>
parents:
5468
diff
changeset
|
114 qps = CrossSectionTrack.getCrossSectionTrack(river.getName(), |
948a106bc4cd
Handle kind filtering in QPS WMS artifact
Andre Heinecke <aheinecke@intevation.de>
parents:
5468
diff
changeset
|
115 getName()); |
948a106bc4cd
Handle kind filtering in QPS WMS artifact
Andre Heinecke <aheinecke@intevation.de>
parents:
5468
diff
changeset
|
116 } |
1836
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
117 |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
118 Envelope max = null; |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
119 |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
120 for (CrossSectionTrack qp: qps) { |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
121 Envelope env = qp.getGeom().getEnvelopeInternal(); |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
122 |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
123 if (max == null) { |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
124 max = env; |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
125 continue; |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
126 } |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
127 |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
128 max.expandToInclude(env); |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
129 } |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
130 |
3918
2fdbe78a8fc2
Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3405
diff
changeset
|
131 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
|
132 ? 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
|
133 : max; |
1836
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
134 } |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
135 |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
136 @Override |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
137 protected String getFilter() { |
5469
948a106bc4cd
Handle kind filtering in QPS WMS artifact
Andre Heinecke <aheinecke@intevation.de>
parents:
5468
diff
changeset
|
138 String kind = getIdPart(2); |
948a106bc4cd
Handle kind filtering in QPS WMS artifact
Andre Heinecke <aheinecke@intevation.de>
parents:
5468
diff
changeset
|
139 if (kind != null && kind.equals("1")) { |
948a106bc4cd
Handle kind filtering in QPS WMS artifact
Andre Heinecke <aheinecke@intevation.de>
parents:
5468
diff
changeset
|
140 // There can be several layers named qps that differ in kind |
948a106bc4cd
Handle kind filtering in QPS WMS artifact
Andre Heinecke <aheinecke@intevation.de>
parents:
5468
diff
changeset
|
141 return "river_id=" + String.valueOf(getRiverId()) + |
948a106bc4cd
Handle kind filtering in QPS WMS artifact
Andre Heinecke <aheinecke@intevation.de>
parents:
5468
diff
changeset
|
142 " AND kind_id=" + kind; |
948a106bc4cd
Handle kind filtering in QPS WMS artifact
Andre Heinecke <aheinecke@intevation.de>
parents:
5468
diff
changeset
|
143 } else if (kind != null) { |
948a106bc4cd
Handle kind filtering in QPS WMS artifact
Andre Heinecke <aheinecke@intevation.de>
parents:
5468
diff
changeset
|
144 return "river_id=" + String.valueOf(getRiverId()) + |
948a106bc4cd
Handle kind filtering in QPS WMS artifact
Andre Heinecke <aheinecke@intevation.de>
parents:
5468
diff
changeset
|
145 " AND kind_id=" + kind + |
948a106bc4cd
Handle kind filtering in QPS WMS artifact
Andre Heinecke <aheinecke@intevation.de>
parents:
5468
diff
changeset
|
146 " AND name='" + getName() + "'"; |
948a106bc4cd
Handle kind filtering in QPS WMS artifact
Andre Heinecke <aheinecke@intevation.de>
parents:
5468
diff
changeset
|
147 } |
948a106bc4cd
Handle kind filtering in QPS WMS artifact
Andre Heinecke <aheinecke@intevation.de>
parents:
5468
diff
changeset
|
148 return "river_id=" + String.valueOf(getRiverId()) + |
948a106bc4cd
Handle kind filtering in QPS WMS artifact
Andre Heinecke <aheinecke@intevation.de>
parents:
5468
diff
changeset
|
149 " AND name='" + getName() + "'"; |
1836
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
150 } |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
151 |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
152 @Override |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
153 protected String getDataString() { |
1845
06c157848c8f
Made the floodmap compatible with an Oracle database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1836
diff
changeset
|
154 String srid = getSrid(); |
06c157848c8f
Made the floodmap compatible with an Oracle database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1836
diff
changeset
|
155 |
06c157848c8f
Made the floodmap compatible with an Oracle database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1836
diff
changeset
|
156 if (FLYSUtils.isUsingOracle()) { |
06c157848c8f
Made the floodmap compatible with an Oracle database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1836
diff
changeset
|
157 return "geom FROM cross_section_tracks USING SRID " + srid; |
06c157848c8f
Made the floodmap compatible with an Oracle database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1836
diff
changeset
|
158 } |
06c157848c8f
Made the floodmap compatible with an Oracle database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1836
diff
changeset
|
159 else { |
06c157848c8f
Made the floodmap compatible with an Oracle database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1836
diff
changeset
|
160 return "geom FROM cross_section_tracks " + |
06c157848c8f
Made the floodmap compatible with an Oracle database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1836
diff
changeset
|
161 "USING UNIQUE id USING SRID " + srid; |
06c157848c8f
Made the floodmap compatible with an Oracle database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1836
diff
changeset
|
162 } |
1836
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
163 } |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
164 |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
165 @Override |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
166 protected String getGeometryType() { |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
167 return "LINE"; |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
168 } |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
169 } // end of WMSQPSState |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
170 } |
729ba79e94a0
Added datacage configuration, loader (Artifact and State) and a theme for cross section tracks.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
171 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |