Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSFloodmapsArtifact.java @ 2599:fb7975828ffa
#544 Added a service that allows querying gauge information.
flys-artifacts/trunk@4175 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 20 Mar 2012 13:51:39 +0000 |
parents | b23c956c5aa2 |
children | f5af3adb3b95 |
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.artifacts.resources.Resources; |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 import de.intevation.flys.utils.FLYSUtils; |
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 protected String floodmapName; |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
82 |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
83 public FloodmapsState(WMSDBArtifact artifact) { |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
84 super(artifact); |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
85 riverId = 0; |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
86 floodmapName = null; |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
87 } |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
88 |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
89 public int getRiverId() { |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
90 if (riverId == 0) { |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
91 String ids = artifact.getDataAsString("ids"); |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
92 |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
93 try { |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
94 String[] parts = ids.split("_"); |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
95 riverId = Integer.valueOf(parts[0]); |
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 catch (NumberFormatException nfe) { |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
98 logger.error("Cannot parse river id from '" + ids + "'"); |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
99 } |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
100 } |
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 return riverId; |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
103 } |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
104 |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
105 public String getFloodmapName() { |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
106 if (floodmapName == null) { |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
107 String ids = artifact.getDataAsString("ids"); |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
108 |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
109 String parts[] = ids.split("_"); |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
110 floodmapName = parts[1]; |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
111 } |
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 return floodmapName; |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
114 } |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
115 |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
116 @Override |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
117 protected String getFacetType() { |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
118 return FLOODMAP_FLOODMAPS; |
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 |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
121 @Override |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
122 protected String getTitle(CallMeta meta) { |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
123 return Resources.getMsg( |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
124 meta, |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
125 FLOODMAP_FLOODMAPS, |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
126 FLOODMAP_FLOODMAPS); |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
127 } |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
128 |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
129 @Override |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
130 protected String getUrl() { |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
131 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
|
132 } |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
133 |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
134 @Override |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
135 protected String getSrid() { |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
136 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
|
137 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
|
138 } |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
139 |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
140 @Override |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
141 protected Envelope getExtent() { |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
142 List<Floodmaps> floodmaps = |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
143 Floodmaps.getFloodmaps(getRiverId(), getFloodmapName()); |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
144 |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
145 Envelope max = null; |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
146 |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
147 for (Floodmaps f: floodmaps) { |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
148 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
|
149 |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
150 if (max == null) { |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
151 max = env; |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
152 continue; |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
153 } |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
154 |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
155 max.expandToInclude(env); |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
156 } |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
157 |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
158 return max; |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
159 } |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
160 |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
161 @Override |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
162 protected String getFilter() { |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
163 return "river_id=" + String.valueOf(getRiverId()) |
2595
b23c956c5aa2
Fixed broken Floodmaps in datacage for floodmap output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2581
diff
changeset
|
164 + " AND name='" + getFloodmapName() + "'"; |
2581
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
165 } |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
166 |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
167 @Override |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
168 protected String getDataString() { |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
169 String srid = getSrid(); |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
170 |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
171 if (FLYSUtils.isUsingOracle()) { |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
172 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
|
173 } |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
174 else { |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
175 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
|
176 } |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
177 } |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
178 |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
179 @Override |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
180 protected String getGeometryType() { |
2595
b23c956c5aa2
Fixed broken Floodmaps in datacage for floodmap output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2581
diff
changeset
|
181 return "POLYGON"; |
2581
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
182 } |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
183 } // end of WMSKmState |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
184 } |
afebbe9c2fce
Added a new Artifact for loading existing 'floodmaps' via datacage.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
185 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |