Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSFloodmarksArtifact.java @ 5805:11bcace6f2fe
Doc.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 24 Apr 2013 11:32:04 +0200 |
parents | 559a009b3d72 |
children |
rev | line source |
---|---|
5552
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.artifacts; |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
2 |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
3 import java.util.List; |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
4 |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
5 import org.w3c.dom.Document; |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
6 |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
7 import org.apache.log4j.Logger; |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
8 |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
9 import com.vividsolutions.jts.geom.Envelope; |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
10 |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
11 import de.intevation.artifacts.ArtifactFactory; |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
12 import de.intevation.artifacts.CallMeta; |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
13 |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
14 import de.intevation.artifactdatabase.state.DefaultOutput; |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
15 import de.intevation.artifactdatabase.state.Facet; |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
16 import de.intevation.artifactdatabase.state.State; |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
17 |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
18 import de.intevation.flys.model.River; |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
19 import de.intevation.flys.model.Floodmark; |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
20 |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
21 import de.intevation.flys.artifacts.model.FacetTypes; |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
22 import de.intevation.flys.artifacts.model.RiverFactory; |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
23 import de.intevation.flys.utils.FLYSUtils; |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
24 import de.intevation.flys.utils.GeometryUtils; |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
25 |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
26 |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
27 public class WMSFloodmarksArtifact extends WMSDBArtifact { |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
28 |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
29 public static final String NAME = "floodmarks"; |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
30 |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
31 |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
32 private static final Logger logger = |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
33 Logger.getLogger(WMSFloodmarksArtifact.class); |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
34 |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
35 |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
36 @Override |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
37 public void setup( |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
38 String identifier, |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
39 ArtifactFactory factory, |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
40 Object context, |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
41 CallMeta callMeta, |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
42 Document data) |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
43 { |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
44 logger.debug("WMSFloodmarksArtifact.setup"); |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
45 |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
46 super.setup(identifier, factory, context, callMeta, data); |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
47 } |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
48 |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
49 |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
50 @Override |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
51 public String getName() { |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
52 return NAME; |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
53 } |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
54 |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
55 |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
56 @Override |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
57 public State getCurrentState(Object cc) { |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
58 State s = new FloodmarksState(this); |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
59 |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
60 List<Facet> fs = getFacets(getCurrentStateId()); |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
61 |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
62 DefaultOutput o = new DefaultOutput( |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
63 "floodmap", |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
64 "floodmap", |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
65 "image/png", |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
66 fs, |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
67 "map"); |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
68 |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
69 s.getOutputs().add(o); |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
70 |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
71 return s; |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
72 } |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
73 |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
74 |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
75 public static class FloodmarksState extends WMSDBState implements FacetTypes |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
76 { |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
77 private static final Logger logger = |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
78 Logger.getLogger(FloodmarksState.class); |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
79 |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
80 protected int riverId; |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
81 |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
82 public FloodmarksState(WMSDBArtifact artifact) { |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
83 super(artifact); |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
84 } |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
85 |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
86 @Override |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
87 protected String getFacetType() { |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
88 return FLOODMAP_FLOODMARKS; |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
89 } |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
90 |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
91 @Override |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
92 protected String getUrl() { |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
93 return FLYSUtils.getUserWMSUrl(artifact.identifier()); |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
94 } |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
95 |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
96 @Override |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
97 protected String getSrid() { |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
98 River river = RiverFactory.getRiver(getRiverId()); |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
99 return FLYSUtils.getRiverSrid(river.getName()); |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
100 } |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
101 |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
102 @Override |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
103 protected Envelope getExtent(boolean reproject) { |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
104 String year = getIdPart(2); |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
105 List<Floodmark> floodmarks; |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
106 if (year != null) { |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
107 floodmarks = Floodmark.getFloodmarks(getRiverId(), |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
108 Integer.parseInt(year)); |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
109 } else { |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
110 floodmarks = Floodmark.getFloodmarks(getRiverId()); |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
111 } |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
112 |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
113 Envelope max = null; |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
114 |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
115 for (Floodmark f: floodmarks) { |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
116 Envelope env = f.getGeom().getEnvelopeInternal(); |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
117 |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
118 if (max == null) { |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
119 max = env; |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
120 continue; |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
121 } |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
122 |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
123 max.expandToInclude(env); |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
124 } |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
125 |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
126 return max != null && reproject |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
127 ? GeometryUtils.transform(max, getSrid()) |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
128 : max; |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
129 } |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
130 |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
131 @Override |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
132 protected String getFilter() { |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
133 String year = getIdPart(2); |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
134 if (year != null) { |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
135 return "river_id=" + String.valueOf(getRiverId()) + |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
136 " AND year=" + getIdPart(2); |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
137 } |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
138 return "river_id=" + String.valueOf(getRiverId()); |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
139 } |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
140 |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
141 @Override |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
142 protected String getDataString() { |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
143 String srid = getSrid(); |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
144 |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
145 if (FLYSUtils.isUsingOracle()) { |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
146 return "geom FROM flood_marks USING SRID " + srid; |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
147 } |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
148 else { |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
149 return "geom FROM flood_marks USING UNIQUE id USING SRID " + srid; |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
150 } |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
151 } |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
152 |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
153 @Override |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
154 protected String getGeometryType() { |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
155 return "POINT"; |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
156 } |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
157 } // end of WMSKmState |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
158 } |
559a009b3d72
Add missing classes for Floodmark, WMSFloodmarksArtifact and WMSJettiesArtifact
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
159 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |