Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/RiverAxisArtifact.java @ 1989:156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
flys-artifacts/trunk@3423 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 15 Dec 2011 12:05:06 +0000 |
parents | 06c157848c8f |
children | 007a8f5ed9f1 |
rev | line source |
---|---|
942
796c54058dc4
Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.artifacts; |
796c54058dc4
Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
796c54058dc4
Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
3 import java.util.List; |
796c54058dc4
Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
4 |
1075
feaf778d510e
Changed the way of collecting the data for the RiverAxisArtifact - use the database instead of a Master-Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
958
diff
changeset
|
5 import org.w3c.dom.Document; |
feaf778d510e
Changed the way of collecting the data for the RiverAxisArtifact - use the database instead of a Master-Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
958
diff
changeset
|
6 |
942
796c54058dc4
Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
7 import org.apache.log4j.Logger; |
796c54058dc4
Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
8 |
1832
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
9 import com.vividsolutions.jts.geom.Envelope; |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
10 import com.vividsolutions.jts.geom.Geometry; |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
11 |
1075
feaf778d510e
Changed the way of collecting the data for the RiverAxisArtifact - use the database instead of a Master-Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
958
diff
changeset
|
12 import de.intevation.artifacts.ArtifactFactory; |
952
7399401f728c
Adapted the method of FLYSArtifact.setup() which has been changed in the artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
942
diff
changeset
|
13 import de.intevation.artifacts.CallMeta; |
942
796c54058dc4
Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
14 |
1832
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
15 import de.intevation.artifactdatabase.state.DefaultOutput; |
942
796c54058dc4
Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
16 import de.intevation.artifactdatabase.state.Facet; |
1832
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
17 import de.intevation.artifactdatabase.state.State; |
942
796c54058dc4
Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
18 |
1075
feaf778d510e
Changed the way of collecting the data for the RiverAxisArtifact - use the database instead of a Master-Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
958
diff
changeset
|
19 import de.intevation.flys.model.River; |
feaf778d510e
Changed the way of collecting the data for the RiverAxisArtifact - use the database instead of a Master-Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
958
diff
changeset
|
20 |
1832
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
21 import de.intevation.flys.artifacts.model.FacetTypes; |
1075
feaf778d510e
Changed the way of collecting the data for the RiverAxisArtifact - use the database instead of a Master-Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
958
diff
changeset
|
22 import de.intevation.flys.artifacts.model.RiverFactory; |
1832
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
23 import de.intevation.flys.artifacts.resources.Resources; |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
24 import de.intevation.flys.utils.FLYSUtils; |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
25 import de.intevation.flys.utils.GeometryUtils; |
942
796c54058dc4
Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 |
796c54058dc4
Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
27 |
1832
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
28 public class RiverAxisArtifact extends WMSDBArtifact { |
942
796c54058dc4
Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 |
796c54058dc4
Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 public static final String NAME = "riveraxis"; |
796c54058dc4
Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 |
796c54058dc4
Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 |
796c54058dc4
Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
33 private static final Logger logger = |
796c54058dc4
Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
34 Logger.getLogger(RiverAxisArtifact.class); |
796c54058dc4
Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 |
796c54058dc4
Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
36 |
796c54058dc4
Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
37 @Override |
1075
feaf778d510e
Changed the way of collecting the data for the RiverAxisArtifact - use the database instead of a Master-Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
958
diff
changeset
|
38 public void setup( |
feaf778d510e
Changed the way of collecting the data for the RiverAxisArtifact - use the database instead of a Master-Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
958
diff
changeset
|
39 String identifier, |
feaf778d510e
Changed the way of collecting the data for the RiverAxisArtifact - use the database instead of a Master-Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
958
diff
changeset
|
40 ArtifactFactory factory, |
feaf778d510e
Changed the way of collecting the data for the RiverAxisArtifact - use the database instead of a Master-Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
958
diff
changeset
|
41 Object context, |
feaf778d510e
Changed the way of collecting the data for the RiverAxisArtifact - use the database instead of a Master-Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
958
diff
changeset
|
42 CallMeta callMeta, |
feaf778d510e
Changed the way of collecting the data for the RiverAxisArtifact - use the database instead of a Master-Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
958
diff
changeset
|
43 Document data) |
feaf778d510e
Changed the way of collecting the data for the RiverAxisArtifact - use the database instead of a Master-Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
958
diff
changeset
|
44 { |
feaf778d510e
Changed the way of collecting the data for the RiverAxisArtifact - use the database instead of a Master-Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
958
diff
changeset
|
45 logger.debug("RiverAxisArtifact.setup"); |
942
796c54058dc4
Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 |
1075
feaf778d510e
Changed the way of collecting the data for the RiverAxisArtifact - use the database instead of a Master-Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
958
diff
changeset
|
47 super.setup(identifier, factory, context, callMeta, data); |
942
796c54058dc4
Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 } |
1075
feaf778d510e
Changed the way of collecting the data for the RiverAxisArtifact - use the database instead of a Master-Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
958
diff
changeset
|
49 |
feaf778d510e
Changed the way of collecting the data for the RiverAxisArtifact - use the database instead of a Master-Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
958
diff
changeset
|
50 |
feaf778d510e
Changed the way of collecting the data for the RiverAxisArtifact - use the database instead of a Master-Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
958
diff
changeset
|
51 @Override |
1832
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
52 public String getName() { |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
53 return NAME; |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
54 } |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
55 |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
56 |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
57 @Override |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
58 public State getCurrentState(Object cc) { |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
59 State s = new RiverAxisState(this); |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
60 |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
61 List<Facet> fs = facets.get(getCurrentStateId()); |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
62 |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
63 DefaultOutput o = new DefaultOutput( |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
64 "floodmap", |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
65 "floodmap", |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
66 "image/png", |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
67 fs, |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
68 "map"); |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
69 |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
70 s.getOutputs().add(o); |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
71 |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
72 return s; |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
73 } |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
74 |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
75 |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
76 public static class RiverAxisState extends WMSDBState implements FacetTypes |
1075
feaf778d510e
Changed the way of collecting the data for the RiverAxisArtifact - use the database instead of a Master-Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
958
diff
changeset
|
77 { |
1832
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
78 private static final Logger logger = |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
79 Logger.getLogger(RiverAxisState.class); |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
80 |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
81 protected Geometry geom; |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
82 protected int riverId; |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
83 |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
84 public RiverAxisState(WMSDBArtifact artifact) { |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
85 super(artifact); |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
86 riverId = 0; |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
87 } |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
88 |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
89 public int getRiverId() { |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
90 if (riverId == 0) { |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
91 String ids = artifact.getDataAsString("ids"); |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
92 |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
93 try { |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
94 riverId = Integer.valueOf(ids); |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
95 } |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
96 catch (NumberFormatException nfe) { |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
97 logger.error("Cannot parse river id from '" + ids + "'"); |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
98 } |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
99 } |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
100 |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
101 return riverId; |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
102 } |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
103 |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
104 @Override |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
105 protected String getFacetType() { |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
106 return FLOODMAP_RIVERAXIS; |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
107 } |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
108 |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
109 @Override |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
110 protected String getTitle(CallMeta meta) { |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
111 return Resources.getMsg( |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
112 meta, |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
113 FLOODMAP_RIVERAXIS, |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
114 FLOODMAP_RIVERAXIS); |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
115 } |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
116 |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
117 @Override |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
118 protected String getUrl() { |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
119 return FLYSUtils.getUserWMSUrl(artifact.identifier()); |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
120 } |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
121 |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
122 @Override |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
123 protected String getSrid() { |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
124 River river = RiverFactory.getRiver(getRiverId()); |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
125 return FLYSUtils.getRiverSrid(river.getName()); |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
126 } |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
127 |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
128 @Override |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
129 protected Envelope getExtent() { |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
130 River river = RiverFactory.getRiver(getRiverId()); |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
131 return GeometryUtils.getRiverBoundary(river.getName()); |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
132 } |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
133 |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
134 @Override |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
135 protected String getFilter() { |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
136 return "river_id=" + String.valueOf(getRiverId()); |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
137 } |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
138 |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
139 @Override |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
140 protected String getDataString() { |
1845
06c157848c8f
Made the floodmap compatible with an Oracle database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1832
diff
changeset
|
141 String srid = getSrid(); |
06c157848c8f
Made the floodmap compatible with an Oracle database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1832
diff
changeset
|
142 |
06c157848c8f
Made the floodmap compatible with an Oracle database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1832
diff
changeset
|
143 if (FLYSUtils.isUsingOracle()) { |
06c157848c8f
Made the floodmap compatible with an Oracle database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1832
diff
changeset
|
144 return "geom FROM river_axes USING SRID " + srid; |
06c157848c8f
Made the floodmap compatible with an Oracle database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1832
diff
changeset
|
145 } |
06c157848c8f
Made the floodmap compatible with an Oracle database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1832
diff
changeset
|
146 else { |
06c157848c8f
Made the floodmap compatible with an Oracle database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1832
diff
changeset
|
147 return "geom FROM river_axes USING UNIQUE id USING SRID " + srid; |
06c157848c8f
Made the floodmap compatible with an Oracle database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1832
diff
changeset
|
148 } |
1832
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
149 } |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
150 |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
151 @Override |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
152 protected String getGeometryType() { |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
153 return "LINE"; |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
154 } |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
155 } // end of WMSKmState |
942
796c54058dc4
Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
156 } |
796c54058dc4
Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
157 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |