annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSFloodmapsArtifact.java @ 4221:480de0dbca8e

Extended location input helper. The locationpicker has now an attribute whether the input is distance or location to display one or two clickable columns. Replaced the record click handler with cell click handler.
author Raimund Renkert <rrenkert@intevation.de>
date Tue, 23 Oct 2012 13:17:20 +0200
parents 2fdbe78a8fc2
children a2735a4bf75e
rev   line source
2581
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.artifacts;
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
2
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
3 import java.util.List;
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
4
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
5 import org.w3c.dom.Document;
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
6
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
7 import org.apache.log4j.Logger;
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
8
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
9 import com.vividsolutions.jts.geom.Envelope;
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
10
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
11 import de.intevation.artifacts.ArtifactFactory;
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
12 import de.intevation.artifacts.CallMeta;
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
13
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
14 import de.intevation.artifactdatabase.state.DefaultOutput;
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
15 import de.intevation.artifactdatabase.state.Facet;
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
16 import de.intevation.artifactdatabase.state.State;
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
17
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
18 import de.intevation.flys.model.River;
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
19 import de.intevation.flys.model.Floodmaps;
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
20
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
21 import de.intevation.flys.artifacts.model.FacetTypes;
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
22 import de.intevation.flys.artifacts.model.RiverFactory;
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
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;
2581
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
25
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
26
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
27 public class WMSFloodmapsArtifact extends WMSDBArtifact {
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
28
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
29 public static final String NAME = "floodmaps";
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
30
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
31
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
32 private static final Logger logger =
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
33 Logger.getLogger(WMSFloodmapsArtifact.class);
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
34
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
35
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
36 @Override
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
37 public void setup(
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
38 String identifier,
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
39 ArtifactFactory factory,
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
40 Object context,
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
41 CallMeta callMeta,
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
42 Document data)
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
43 {
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
44 logger.debug("WMSFloodmapsArtifact.setup");
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
45
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
46 super.setup(identifier, factory, context, callMeta, data);
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
47 }
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
48
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
49
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
50 @Override
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
51 public String getName() {
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
52 return NAME;
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
53 }
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
54
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
55
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
56 @Override
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
57 public State getCurrentState(Object cc) {
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
58 State s = new FloodmapsState(this);
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
59
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
60 List<Facet> fs = facets.get(getCurrentStateId());
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
61
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
62 DefaultOutput o = new DefaultOutput(
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
63 "floodmap",
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
64 "floodmap",
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
65 "image/png",
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
66 fs,
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
67 "map");
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
68
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
69 s.getOutputs().add(o);
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
70
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
71 return s;
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
72 }
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
73
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
74
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
75 public static class FloodmapsState extends WMSDBState implements FacetTypes
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
76 {
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
77 private static final Logger logger =
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
78 Logger.getLogger(FloodmapsState.class);
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
79
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
80 protected int riverId;
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
81
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
82 public FloodmapsState(WMSDBArtifact artifact) {
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
83 super(artifact);
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
84 riverId = 0;
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
85 }
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
86
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
87 @Override
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
88 protected String getFacetType() {
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
89 return FLOODMAP_FLOODMAPS;
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
90 }
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
91
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
92 @Override
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
93 protected String getUrl() {
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
94 return FLYSUtils.getUserWMSUrl(artifact.identifier());
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
95 }
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
96
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
97 @Override
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
98 protected String getSrid() {
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
99 River river = RiverFactory.getRiver(getRiverId());
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
100 return FLYSUtils.getRiverSrid(river.getName());
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
101 }
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
102
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
103 @Override
3918
2fdbe78a8fc2 Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3301
diff changeset
104 protected Envelope getExtent(boolean reproject) {
2581
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
105 List<Floodmaps> floodmaps =
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: 2595
diff changeset
106 Floodmaps.getFloodmaps(getRiverId(), getName());
2581
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
107
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
108 Envelope max = null;
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
109
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
110 for (Floodmaps f: floodmaps) {
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
111 Envelope env = f.getGeom().getEnvelopeInternal();
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
112
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
113 if (max == null) {
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
114 max = env;
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
115 continue;
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
116 }
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
117
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
118 max.expandToInclude(env);
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
119 }
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
120
3918
2fdbe78a8fc2 Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3301
diff changeset
121 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
122 ? 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
123 : max;
2581
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
124 }
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
125
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
126 @Override
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
127 protected String getFilter() {
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
128 return "river_id=" + String.valueOf(getRiverId())
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: 2595
diff changeset
129 + " AND name='" + getName() + "'";
2581
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
130 }
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
131
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
132 @Override
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
133 protected String getDataString() {
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
134 String srid = getSrid();
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
135
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
136 if (FLYSUtils.isUsingOracle()) {
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
137 return "geom FROM floodmaps USING SRID " + srid;
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
138 }
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
139 else {
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
140 return "geom FROM floodmaps USING UNIQUE id USING SRID " + srid;
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
141 }
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
142 }
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
143
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
144 @Override
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
145 protected String getGeometryType() {
2595
b23c956c5aa2 Fixed broken Floodmaps in datacage for floodmap output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2581
diff changeset
146 return "POLYGON";
2581
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
147 }
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
148 } // end of WMSKmState
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
149 }
afebbe9c2fce Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
150 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org