Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/artifacts/RiverAxisArtifact.java @ 8202:e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Fri, 05 Sep 2014 12:58:17 +0200 |
parents | 92a2b9b691e1 |
children | e9d912c97fa8 |
rev | line source |
---|---|
5863
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde |
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
2 * Software engineering by Intevation GmbH |
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
3 * |
5994
af13ceeba52a
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5867
diff
changeset
|
4 * This file is Free Software under the GNU AGPL (>=v3) |
5863
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
5994
af13ceeba52a
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5867
diff
changeset
|
6 * documentation coming with Dive4Elements River for details. |
5863
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
7 */ |
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
8 |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5477
diff
changeset
|
9 package org.dive4elements.river.artifacts; |
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
|
10 |
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
|
11 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
|
12 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
|
13 |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5477
diff
changeset
|
14 import org.dive4elements.artifactdatabase.state.DefaultOutput; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5477
diff
changeset
|
15 import org.dive4elements.artifactdatabase.state.Facet; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5477
diff
changeset
|
16 import org.dive4elements.artifactdatabase.state.State; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5477
diff
changeset
|
17 import org.dive4elements.river.artifacts.model.FacetTypes; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5477
diff
changeset
|
18 import org.dive4elements.river.artifacts.model.RiverFactory; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5477
diff
changeset
|
19 import org.dive4elements.river.model.River; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5477
diff
changeset
|
20 import org.dive4elements.river.model.RiverAxis; |
5865
73da40528cf2
River artifacts: Renamed FLYSUtils to RiverUtils.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
21 import org.dive4elements.river.utils.RiverUtils; |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5477
diff
changeset
|
22 import org.dive4elements.river.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
|
23 |
4864
dc0d37715e16
Floodmap uses the static River-WMS instead of User-WMS via RiverAxisArtifact.
Christian Lins <christian.lins@intevation.de>
parents:
4497
diff
changeset
|
24 import java.util.List; |
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
|
25 |
4864
dc0d37715e16
Floodmap uses the static River-WMS instead of User-WMS via RiverAxisArtifact.
Christian Lins <christian.lins@intevation.de>
parents:
4497
diff
changeset
|
26 import org.apache.log4j.Logger; |
dc0d37715e16
Floodmap uses the static River-WMS instead of User-WMS via RiverAxisArtifact.
Christian Lins <christian.lins@intevation.de>
parents:
4497
diff
changeset
|
27 |
dc0d37715e16
Floodmap uses the static River-WMS instead of User-WMS via RiverAxisArtifact.
Christian Lins <christian.lins@intevation.de>
parents:
4497
diff
changeset
|
28 @Deprecated |
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
|
29 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
|
30 |
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 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
|
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 |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7855
diff
changeset
|
34 private static final Logger log = |
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
|
35 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
|
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 |
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
|
38 @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
|
39 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
|
40 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
|
41 } |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
42 |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
43 |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
44 @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
|
45 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
|
46 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
|
47 |
4497
a2735a4bf75e
Change facets member variable to private
Björn Ricks <bjoern.ricks@intevation.de>
parents:
3923
diff
changeset
|
48 List<Facet> fs = getFacets(getCurrentStateId()); |
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
|
49 |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
50 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
|
51 "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
|
52 "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
|
53 "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
|
54 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
|
55 "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
|
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 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
|
58 |
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 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
|
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 |
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 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
|
64 { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7855
diff
changeset
|
65 private static final Logger log = |
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
|
66 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
|
67 |
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 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
|
69 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
|
70 |
2082
007a8f5ed9f1
Implemented new module "new map".
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1845
diff
changeset
|
71 public RiverAxisState(){} |
007a8f5ed9f1
Implemented new module "new map".
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1845
diff
changeset
|
72 |
5867
59ff03ff48f1
River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5865
diff
changeset
|
73 public RiverAxisState(D4EArtifact artifact) { |
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
|
74 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
|
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 |
6705
f3d0aac478cd
issue766: Minimal fix for doubled RiverAxis.
Andre Heinecke <aheinecke@intevation.de>
parents:
5994
diff
changeset
|
77 private boolean isUnofficial() { |
f3d0aac478cd
issue766: Minimal fix for doubled RiverAxis.
Andre Heinecke <aheinecke@intevation.de>
parents:
5994
diff
changeset
|
78 return getIdPart(2) != null && !getIdPart(2).equals("1"); |
f3d0aac478cd
issue766: Minimal fix for doubled RiverAxis.
Andre Heinecke <aheinecke@intevation.de>
parents:
5994
diff
changeset
|
79 } |
f3d0aac478cd
issue766: Minimal fix for doubled RiverAxis.
Andre Heinecke <aheinecke@intevation.de>
parents:
5994
diff
changeset
|
80 |
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
|
81 @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
|
82 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
|
83 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
|
84 } |
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 |
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 @Override |
4864
dc0d37715e16
Floodmap uses the static River-WMS instead of User-WMS via RiverAxisArtifact.
Christian Lins <christian.lins@intevation.de>
parents:
4497
diff
changeset
|
87 protected String getLayer() { |
6705
f3d0aac478cd
issue766: Minimal fix for doubled RiverAxis.
Andre Heinecke <aheinecke@intevation.de>
parents:
5994
diff
changeset
|
88 if (isUnofficial()) { |
f3d0aac478cd
issue766: Minimal fix for doubled RiverAxis.
Andre Heinecke <aheinecke@intevation.de>
parents:
5994
diff
changeset
|
89 return super.getLayer(); |
f3d0aac478cd
issue766: Minimal fix for doubled RiverAxis.
Andre Heinecke <aheinecke@intevation.de>
parents:
5994
diff
changeset
|
90 } |
4864
dc0d37715e16
Floodmap uses the static River-WMS instead of User-WMS via RiverAxisArtifact.
Christian Lins <christian.lins@intevation.de>
parents:
4497
diff
changeset
|
91 return RiverFactory.getRiver(getRiverId()).getName(); |
dc0d37715e16
Floodmap uses the static River-WMS instead of User-WMS via RiverAxisArtifact.
Christian Lins <christian.lins@intevation.de>
parents:
4497
diff
changeset
|
92 } |
dc0d37715e16
Floodmap uses the static River-WMS instead of User-WMS via RiverAxisArtifact.
Christian Lins <christian.lins@intevation.de>
parents:
4497
diff
changeset
|
93 |
dc0d37715e16
Floodmap uses the static River-WMS instead of User-WMS via RiverAxisArtifact.
Christian Lins <christian.lins@intevation.de>
parents:
4497
diff
changeset
|
94 @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
|
95 protected String getUrl() { |
6705
f3d0aac478cd
issue766: Minimal fix for doubled RiverAxis.
Andre Heinecke <aheinecke@intevation.de>
parents:
5994
diff
changeset
|
96 if (isUnofficial()) { |
f3d0aac478cd
issue766: Minimal fix for doubled RiverAxis.
Andre Heinecke <aheinecke@intevation.de>
parents:
5994
diff
changeset
|
97 return RiverUtils.getUserWMSUrl(artifact.identifier()); |
f3d0aac478cd
issue766: Minimal fix for doubled RiverAxis.
Andre Heinecke <aheinecke@intevation.de>
parents:
5994
diff
changeset
|
98 } else { |
f3d0aac478cd
issue766: Minimal fix for doubled RiverAxis.
Andre Heinecke <aheinecke@intevation.de>
parents:
5994
diff
changeset
|
99 return RiverUtils.getRiverWMSUrl(); |
f3d0aac478cd
issue766: Minimal fix for doubled RiverAxis.
Andre Heinecke <aheinecke@intevation.de>
parents:
5994
diff
changeset
|
100 } |
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
|
101 } |
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 @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
|
104 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
|
105 River river = RiverFactory.getRiver(getRiverId()); |
5865
73da40528cf2
River artifacts: Renamed FLYSUtils to RiverUtils.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
106 return RiverUtils.getRiverSrid(river.getName()); |
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
|
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 |
3918
2fdbe78a8fc2
Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3405
diff
changeset
|
110 protected Envelope getExtent(boolean reproject) { |
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
|
111 River river = RiverFactory.getRiver(getRiverId()); |
5477
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
112 List<RiverAxis> axes; |
3923
9fac337192c9
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3918
diff
changeset
|
113 |
5477
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
114 String kind = getIdPart(2); |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
115 |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
116 if (kind != null && kind.equals("1")) { |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
117 axes = RiverAxis.getRiverAxis(river.getName(), |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
118 Integer.parseInt(kind)); |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
119 } else if (kind != null) { |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
120 axes = RiverAxis.getRiverAxis(river.getName(), |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
121 getName(), Integer.parseInt(kind)); |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
122 } else { |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
123 if (reproject) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7855
diff
changeset
|
124 log.debug("Query extent for RiverAxis with Srid: " + getSrid()); |
5477
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
125 return GeometryUtils.transform( |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
126 GeometryUtils.getRiverBoundary(river.getName()), |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
127 getSrid()); |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
128 } else { |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
129 return GeometryUtils.transform( |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
130 GeometryUtils.getRiverBoundary(river.getName()), |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
131 "31467"); |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
132 } |
3918
2fdbe78a8fc2
Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3405
diff
changeset
|
133 } |
5477
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
134 |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
135 Envelope max = null; |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
136 |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
137 for (RiverAxis ax: axes) { |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
138 Envelope env = ax.getGeom().getEnvelopeInternal(); |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
139 |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
140 if (max == null) { |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
141 max = env; |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
142 continue; |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
143 } |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
144 |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
145 max.expandToInclude(env); |
3918
2fdbe78a8fc2
Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3405
diff
changeset
|
146 } |
5477
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
147 |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
148 return max != null && reproject |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
149 ? GeometryUtils.transform(max, getSrid()) |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
150 : max; |
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
|
151 } |
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 |
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 @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
|
154 protected String getFilter() { |
5477
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
155 String kind = getIdPart(2); |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
156 if (kind != null && kind.equals("1")) { |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
157 return "river_id=" + String.valueOf(getRiverId()) + |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
158 " AND kind_id=" + kind; |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
159 } else if (kind != null) { |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
160 return "river_id=" + String.valueOf(getRiverId()) + |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
161 " AND kind_id=" + kind + |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
162 " AND name='" + getName() + "'"; |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
163 } else if (getIdPart(1) != null) { |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
164 return "river_id=" + String.valueOf(getRiverId()) + |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
165 " AND name='" + getName() + "'"; |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
166 } |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
167 return "river_id=" + String.valueOf(getRiverId()) + |
ae60bb7b8085
Add proper handling of multiple river_axes for datacage and rivermapfile
Andre Heinecke <aheinecke@intevation.de>
parents:
5304
diff
changeset
|
168 " AND kind_id=" + kind; |
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
|
169 } |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
170 |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
171 @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
|
172 protected String getDataString() { |
5865
73da40528cf2
River artifacts: Renamed FLYSUtils to RiverUtils.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
173 if (RiverUtils.isUsingOracle()) { |
5304
ffa5eaad3a7b
Fix river_axes maps when using oracle.
Andre Heinecke <aheinecke@intevation.de>
parents:
4864
diff
changeset
|
174 return "geom FROM river_axes USING SRID " + getSrid(); |
1845
06c157848c8f
Made the floodmap compatible with an Oracle database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1832
diff
changeset
|
175 } |
06c157848c8f
Made the floodmap compatible with an Oracle database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1832
diff
changeset
|
176 else { |
3918
2fdbe78a8fc2
Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3405
diff
changeset
|
177 return "geom FROM river_axes USING UNIQUE id"; |
1845
06c157848c8f
Made the floodmap compatible with an Oracle database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1832
diff
changeset
|
178 } |
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
|
179 } |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
180 |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
181 @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
|
182 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
|
183 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
|
184 } |
a8910c1c82fb
Refactored the RiverAxisArtifact and its State - uses the same base as WMSKmArtifact now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1771
diff
changeset
|
185 } // 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
|
186 } |
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
|
187 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |