Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/exports/MapGenerator.java @ 9619:63bbd5e45839
#21 WMS Legend
author | dnt_bjoernsen <d.tironi@bjoernsen.de> |
---|---|
date | Thu, 10 Oct 2019 16:08:47 +0200 |
parents | 5e38e2924c07 |
children |
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:
5655
diff
changeset
|
9 package org.dive4elements.river.exports; |
1774
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 |
9619 | 11 import java.io.File; |
12 import java.io.FileNotFoundException; | |
13 import java.io.IOException; | |
14 import java.io.OutputStream; | |
15 import java.util.ArrayList; | |
16 import java.util.List; | |
17 | |
18 import org.apache.log4j.Logger; | |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5655
diff
changeset
|
19 import org.dive4elements.artifactdatabase.data.StateData; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5655
diff
changeset
|
20 import org.dive4elements.artifactdatabase.state.ArtifactAndFacet; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5655
diff
changeset
|
21 import org.dive4elements.artifactdatabase.state.Facet; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5655
diff
changeset
|
22 import org.dive4elements.artifactdatabase.state.Settings; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5655
diff
changeset
|
23 import org.dive4elements.artifacts.Artifact; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5655
diff
changeset
|
24 import org.dive4elements.artifacts.CallContext; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5655
diff
changeset
|
25 import org.dive4elements.artifacts.common.ArtifactNamespaceContext; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5655
diff
changeset
|
26 import org.dive4elements.artifacts.common.utils.XMLUtils; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5655
diff
changeset
|
27 import org.dive4elements.artifacts.common.utils.XMLUtils.ElementCreator; |
5867
59ff03ff48f1
River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
28 import org.dive4elements.river.artifacts.D4EArtifact; |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5655
diff
changeset
|
29 import org.dive4elements.river.artifacts.model.FacetTypes; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5655
diff
changeset
|
30 import org.dive4elements.river.artifacts.model.map.WMSDBLayerFacet; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5655
diff
changeset
|
31 import org.dive4elements.river.artifacts.model.map.WMSLayerFacet; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5655
diff
changeset
|
32 import org.dive4elements.river.artifacts.model.map.WSPLGENLayerFacet; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5655
diff
changeset
|
33 import org.dive4elements.river.artifacts.states.WaterlevelGroundDifferences; |
5867
59ff03ff48f1
River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
34 import org.dive4elements.river.collections.D4EArtifactCollection; |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6833
diff
changeset
|
35 import org.dive4elements.river.themes.ThemeDocument; |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5655
diff
changeset
|
36 import org.dive4elements.river.utils.ArtifactMapfileGenerator; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5655
diff
changeset
|
37 import org.dive4elements.river.utils.GeometryUtils; |
3306
1b41dc00b1f7
Create shapefile directory instead of shapefile 'file'
Christian Lins <christian.lins@intevation.de>
parents:
3302
diff
changeset
|
38 import org.w3c.dom.Document; |
1b41dc00b1f7
Create shapefile directory instead of shapefile 'file'
Christian Lins <christian.lins@intevation.de>
parents:
3302
diff
changeset
|
39 import org.w3c.dom.Element; |
1b41dc00b1f7
Create shapefile directory instead of shapefile 'file'
Christian Lins <christian.lins@intevation.de>
parents:
3302
diff
changeset
|
40 |
6831
8c7433b8656d
Backed out changeset 74a437805e2a
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6826
diff
changeset
|
41 import com.vividsolutions.jts.geom.Envelope; |
8c7433b8656d
Backed out changeset 74a437805e2a
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6826
diff
changeset
|
42 |
1774
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
43 public class MapGenerator implements OutGenerator, FacetTypes { |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7087
diff
changeset
|
45 private static Logger log = Logger.getLogger(MapGenerator.class); |
1774
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 |
5867
59ff03ff48f1
River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
47 protected D4EArtifactCollection collection; |
3422
118fe1cc8cc8
OutGenerators got a setCollection() method; analogous to setMasterArtifact(). Registered the SQOverviewGenerator as OutGenerator for 'sq_overview' Output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3306
diff
changeset
|
48 |
1774
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 protected Artifact master; |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 |
2047
0318fa6f0844
Make use of first attributes specified in the ChartSettings. NOTE: work is still in progress.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1979
diff
changeset
|
51 protected Settings settings; |
0318fa6f0844
Make use of first attributes specified in the ChartSettings. NOTE: work is still in progress.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1979
diff
changeset
|
52 |
1774
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
53 protected Document request; |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
54 |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
55 protected OutputStream out; |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
56 |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 protected CallContext context; |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 protected List<WMSLayerFacet> layers; |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
60 |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
61 protected Envelope maxExtent; |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
62 protected Envelope initialExtent; |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
64 protected String srid; |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
65 |
7077
0a337f0005c2
Extended init() of OutGenerator to take name of the out to serve.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7037
diff
changeset
|
66 protected String outName; |
0a337f0005c2
Extended init() of OutGenerator to take name of the out to serve.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7037
diff
changeset
|
67 |
9619 | 68 private String legend; |
69 | |
7037
5c6fd2c010dd
Add setup(Element config) method to Generator interface to be initialized from configuration.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
70 @Override |
9619 | 71 public void setup(final Object config) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7087
diff
changeset
|
72 log.debug("MapGenerator.setup"); |
7037
5c6fd2c010dd
Add setup(Element config) method to Generator interface to be initialized from configuration.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
73 } |
1774
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
74 |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
75 @Override |
9619 | 76 public void init(final String outName, final Document request, final OutputStream out, final CallContext context) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7087
diff
changeset
|
77 log.debug("MapGenerator.init"); |
1774
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
78 |
9619 | 79 this.outName = outName; |
80 this.request = request; | |
81 this.out = out; | |
82 this.context = context; | |
1774
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
83 |
9619 | 84 this.layers = new ArrayList<>(); |
1774
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
85 |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
86 this.maxExtent = null; |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
87 this.initialExtent = null; |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
88 } |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
89 |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
90 @Override |
9619 | 91 public void setMasterArtifact(final Artifact master) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7087
diff
changeset
|
92 log.debug("MapGenerator.setMasterArtifact"); |
1774
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
93 this.master = master; |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
94 } |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
95 |
3422
118fe1cc8cc8
OutGenerators got a setCollection() method; analogous to setMasterArtifact(). Registered the SQOverviewGenerator as OutGenerator for 'sq_overview' Output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3306
diff
changeset
|
96 @Override |
9619 | 97 public void setCollection(final D4EArtifactCollection collection) { |
3422
118fe1cc8cc8
OutGenerators got a setCollection() method; analogous to setMasterArtifact(). Registered the SQOverviewGenerator as OutGenerator for 'sq_overview' Output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3306
diff
changeset
|
98 this.collection = collection; |
118fe1cc8cc8
OutGenerators got a setCollection() method; analogous to setMasterArtifact(). Registered the SQOverviewGenerator as OutGenerator for 'sq_overview' Output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3306
diff
changeset
|
99 } |
1774
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
100 |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
101 @Override |
9619 | 102 public void doOut(final ArtifactAndFacet artifactFacet, final ThemeDocument attr, final boolean visible) { |
103 final String name = artifactFacet.getFacetName(); | |
1774
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
104 |
9619 | 105 log.debug("MapGenerator.doOut: " + artifactFacet.getArtifact().identifier() + " | " + name); |
106 final D4EArtifact flys = (D4EArtifact) artifactFacet.getArtifact(); | |
1774
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
107 |
9619 | 108 final Facet nativeFacet = artifactFacet.getFacet(); |
1774
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
109 |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
110 if (nativeFacet instanceof WMSLayerFacet) { |
9619 | 111 final WMSLayerFacet wms = (WMSLayerFacet) nativeFacet; |
112 final Envelope extent = wms.getOriginalExtent(); | |
1774
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
113 |
9619 | 114 this.layers.add(wms); |
1774
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
115 |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
116 setMaxExtent(extent); |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
117 setSrid(wms.getSrid()); |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
118 |
1775
0156105222c9
Improved the MapfileGenerator. It offers methods to create barrier and wsplgen layer files for mapserver.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1774
diff
changeset
|
119 if (FLOODMAP_WSPLGEN.equals(name)) { |
2091
5d158f8ad080
#298 Fixed broken auto-zoom-to-wsplgen in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2082
diff
changeset
|
120 setInitialExtent(extent); |
2616
27cc95e65f18
Defined a style for WSPLGEN layers which are now modifiable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2091
diff
changeset
|
121 createWSPLGENLayer(flys, wms, attr); |
1775
0156105222c9
Improved the MapfileGenerator. It offers methods to create barrier and wsplgen layer files for mapserver.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1774
diff
changeset
|
122 } |
6833
20f98087664d
(issue657) Prevent errornous recreation of usershape mapfile fragment.
Christian Lins <christian.lins@intevation.de>
parents:
6831
diff
changeset
|
123 // FIXME: Already generated by HWSBarrierState |
20f98087664d
(issue657) Prevent errornous recreation of usershape mapfile fragment.
Christian Lins <christian.lins@intevation.de>
parents:
6831
diff
changeset
|
124 // wms has a wrong SRID which would break that layer |
9619 | 125 // else if (FLOODMAP_USERSHAPE.equals(name)) { |
126 // createUserShapeLayer(flys, wms); | |
127 // } | |
1792
49ad801076e4
Enabled the MapGenerator to create WMS layers with database datastore - riveraxis is the first layer that is no longer fetched from static WMS service but from user specific one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1781
diff
changeset
|
128 else { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7087
diff
changeset
|
129 log.debug("doOut: createDatabaseLayer for facet name: " + name); |
1793
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1792
diff
changeset
|
130 createDatabaseLayer(flys, wms, attr); |
1792
49ad801076e4
Enabled the MapGenerator to create WMS layers with database datastore - riveraxis is the first layer that is no longer fetched from static WMS service but from user specific one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1781
diff
changeset
|
131 } |
9619 | 132 } else { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7087
diff
changeset
|
133 log.warn("Facet not supported: " + nativeFacet.getClass()); |
1774
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
134 } |
1775
0156105222c9
Improved the MapfileGenerator. It offers methods to create barrier and wsplgen layer files for mapserver.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1774
diff
changeset
|
135 } |
1774
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
136 |
9619 | 137 protected void createWSPLGENLayer(final D4EArtifact flys, final WMSLayerFacet wms, final ThemeDocument attr) { |
1776
7d1bd710a4b3
Made flys-artifacts compilable again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1775
diff
changeset
|
138 try { |
9619 | 139 if (wms instanceof WSPLGENLayerFacet) { |
5655
53a2ceeae9a3
Create floodmap colorrange dynamically from artifact parameters. Theme setting for colorrange classes is currently not functioning (wasn't before either).
Christian Lins <christian.lins@intevation.de>
parents:
4864
diff
changeset
|
140 // Retrieve waterlevel ground differences from artifact |
9619 | 141 final StateData dFrom = flys.getData(WaterlevelGroundDifferences.LOWER_FIELD); |
142 final StateData dTo = flys.getData(WaterlevelGroundDifferences.UPPER_FIELD); | |
143 final StateData dStep = flys.getData(WaterlevelGroundDifferences.DIFF_FIELD); | |
5655
53a2ceeae9a3
Create floodmap colorrange dynamically from artifact parameters. Theme setting for colorrange classes is currently not functioning (wasn't before either).
Christian Lins <christian.lins@intevation.de>
parents:
4864
diff
changeset
|
144 |
9619 | 145 final String fromStr = dFrom != null ? (String) dFrom.getValue() : null; |
146 final String toStr = dTo != null ? (String) dTo.getValue() : null; | |
147 final String stepStr = dStep != null ? (String) dStep.getValue() : null; | |
5655
53a2ceeae9a3
Create floodmap colorrange dynamically from artifact parameters. Theme setting for colorrange classes is currently not functioning (wasn't before either).
Christian Lins <christian.lins@intevation.de>
parents:
4864
diff
changeset
|
148 |
9619 | 149 final float from = Float.parseFloat(fromStr); |
150 final float to = Float.parseFloat(toStr); | |
151 final float step = Float.parseFloat(stepStr); | |
5655
53a2ceeae9a3
Create floodmap colorrange dynamically from artifact parameters. Theme setting for colorrange classes is currently not functioning (wasn't before either).
Christian Lins <christian.lins@intevation.de>
parents:
4864
diff
changeset
|
152 |
9619 | 153 final ArtifactMapfileGenerator mfg = new ArtifactMapfileGenerator(); |
154 mfg.createUeskLayer(flys, (WSPLGENLayerFacet) wms, attr.createDynamicMapserverStyle(from, to, step, this.context.getMeta()), this.context); | |
155 } else { | |
156 log.warn("Cannot create WSPLGEN layer from: " + wms.getClass()); | |
2638
ccad7a6ddaa4
Issue 560.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2637
diff
changeset
|
157 } |
1776
7d1bd710a4b3
Made flys-artifacts compilable again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1775
diff
changeset
|
158 } |
9619 | 159 catch (final IOException ioe) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7087
diff
changeset
|
160 log.error(ioe, ioe); |
1776
7d1bd710a4b3
Made flys-artifacts compilable again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1775
diff
changeset
|
161 } |
1775
0156105222c9
Improved the MapfileGenerator. It offers methods to create barrier and wsplgen layer files for mapserver.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1774
diff
changeset
|
162 } |
0156105222c9
Improved the MapfileGenerator. It offers methods to create barrier and wsplgen layer files for mapserver.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1774
diff
changeset
|
163 |
9619 | 164 protected void createUserShapeLayer(final D4EArtifact flys, final WMSLayerFacet wms) { |
165 final ArtifactMapfileGenerator mfg = new ArtifactMapfileGenerator(); | |
2639
a78dafdd8590
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2638
diff
changeset
|
166 |
a78dafdd8590
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2638
diff
changeset
|
167 try { |
a78dafdd8590
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2638
diff
changeset
|
168 mfg.createUserShapeLayer(flys, wms); |
a78dafdd8590
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2638
diff
changeset
|
169 } |
9619 | 170 catch (final FileNotFoundException fnfe) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7087
diff
changeset
|
171 log.error(fnfe, fnfe); |
2639
a78dafdd8590
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2638
diff
changeset
|
172 } |
9619 | 173 catch (final IOException ioe) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7087
diff
changeset
|
174 log.error(ioe, ioe); |
2639
a78dafdd8590
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2638
diff
changeset
|
175 } |
a78dafdd8590
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2638
diff
changeset
|
176 } |
a78dafdd8590
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2638
diff
changeset
|
177 |
9619 | 178 protected void createDatabaseLayer(final D4EArtifact flys, final WMSLayerFacet wms, final ThemeDocument attr) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7087
diff
changeset
|
179 log.debug("createDatabaseLayer for facet: " + wms.getName()); |
1792
49ad801076e4
Enabled the MapGenerator to create WMS layers with database datastore - riveraxis is the first layer that is no longer fetched from static WMS service but from user specific one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1781
diff
changeset
|
180 |
9619 | 181 final ArtifactMapfileGenerator mfg = new ArtifactMapfileGenerator(); |
1792
49ad801076e4
Enabled the MapGenerator to create WMS layers with database datastore - riveraxis is the first layer that is no longer fetched from static WMS service but from user specific one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1781
diff
changeset
|
182 |
49ad801076e4
Enabled the MapGenerator to create WMS layers with database datastore - riveraxis is the first layer that is no longer fetched from static WMS service but from user specific one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1781
diff
changeset
|
183 try { |
9619 | 184 final File baseDir = mfg.getShapefileBaseDir(); |
185 final File artDir = new File(baseDir, flys.identifier()); | |
1792
49ad801076e4
Enabled the MapGenerator to create WMS layers with database datastore - riveraxis is the first layer that is no longer fetched from static WMS service but from user specific one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1781
diff
changeset
|
186 |
49ad801076e4
Enabled the MapGenerator to create WMS layers with database datastore - riveraxis is the first layer that is no longer fetched from static WMS service but from user specific one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1781
diff
changeset
|
187 if (artDir != null && !artDir.exists()) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7087
diff
changeset
|
188 log.debug("Create new directory: " + artDir.getPath()); |
1792
49ad801076e4
Enabled the MapGenerator to create WMS layers with database datastore - riveraxis is the first layer that is no longer fetched from static WMS service but from user specific one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1781
diff
changeset
|
189 artDir.mkdir(); |
49ad801076e4
Enabled the MapGenerator to create WMS layers with database datastore - riveraxis is the first layer that is no longer fetched from static WMS service but from user specific one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1781
diff
changeset
|
190 } |
49ad801076e4
Enabled the MapGenerator to create WMS layers with database datastore - riveraxis is the first layer that is no longer fetched from static WMS service but from user specific one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1781
diff
changeset
|
191 |
49ad801076e4
Enabled the MapGenerator to create WMS layers with database datastore - riveraxis is the first layer that is no longer fetched from static WMS service but from user specific one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1781
diff
changeset
|
192 if (wms instanceof WMSDBLayerFacet) { |
9619 | 193 mfg.createDatabaseLayer(flys, (WMSDBLayerFacet) wms, attr.createMapserverStyle()); |
194 } else { | |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7087
diff
changeset
|
195 log.warn("Cannot create DB layer from: " + wms.getClass()); |
1792
49ad801076e4
Enabled the MapGenerator to create WMS layers with database datastore - riveraxis is the first layer that is no longer fetched from static WMS service but from user specific one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1781
diff
changeset
|
196 } |
49ad801076e4
Enabled the MapGenerator to create WMS layers with database datastore - riveraxis is the first layer that is no longer fetched from static WMS service but from user specific one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1781
diff
changeset
|
197 } |
9619 | 198 catch (final FileNotFoundException fnfe) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7087
diff
changeset
|
199 log.error(fnfe, fnfe); |
1792
49ad801076e4
Enabled the MapGenerator to create WMS layers with database datastore - riveraxis is the first layer that is no longer fetched from static WMS service but from user specific one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1781
diff
changeset
|
200 } |
9619 | 201 catch (final IOException ioe) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7087
diff
changeset
|
202 log.error(ioe, ioe); |
1792
49ad801076e4
Enabled the MapGenerator to create WMS layers with database datastore - riveraxis is the first layer that is no longer fetched from static WMS service but from user specific one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1781
diff
changeset
|
203 } |
49ad801076e4
Enabled the MapGenerator to create WMS layers with database datastore - riveraxis is the first layer that is no longer fetched from static WMS service but from user specific one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1781
diff
changeset
|
204 } |
49ad801076e4
Enabled the MapGenerator to create WMS layers with database datastore - riveraxis is the first layer that is no longer fetched from static WMS service but from user specific one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1781
diff
changeset
|
205 |
1774
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
206 @Override |
9619 | 207 public void generate() throws IOException { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7087
diff
changeset
|
208 log.debug("MapGenerator.generate"); |
1774
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
209 |
9619 | 210 final ArtifactMapfileGenerator mfg = new ArtifactMapfileGenerator(); |
4654
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
4633
diff
changeset
|
211 mfg.generate(); |
1781
ef2300b450bf
Modified the process to create mapfiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1776
diff
changeset
|
212 |
9619 | 213 final Document response = XMLUtils.newDocument(); |
214 final ElementCreator c = new ElementCreator(response, ArtifactNamespaceContext.NAMESPACE_URI, ArtifactNamespaceContext.NAMESPACE_PREFIX); | |
1774
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
215 |
9619 | 216 final Element root = c.create("floodmap"); |
217 final Element layers = c.create("layers"); | |
1774
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
218 |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
219 response.appendChild(root); |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
220 root.appendChild(layers); |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
221 |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
222 appendLayers(layers); |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
223 appendMapInformation(root, c); |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
224 |
9619 | 225 XMLUtils.toStream(response, this.out); |
8816
f5e126739c36
min and max must not be equal in LAYER EXTENT in mapfile.
Tom Gottfried <tom@intevation.de>
parents:
8746
diff
changeset
|
226 } |
1774
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
227 |
9619 | 228 protected void appendLayers(final Element parent) { |
229 for (final WMSLayerFacet facet : this.layers) { | |
1774
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
230 parent.appendChild(facet.toXML(parent.getOwnerDocument())); |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
231 } |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
232 } |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
233 |
9619 | 234 protected void setMaxExtent(final Envelope maxExtent) { |
1774
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
235 if (maxExtent == null) { |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
236 return; |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
237 } |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
238 |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
239 if (this.maxExtent == null) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7087
diff
changeset
|
240 log.debug("Set max extent to: " + maxExtent); |
2091
5d158f8ad080
#298 Fixed broken auto-zoom-to-wsplgen in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2082
diff
changeset
|
241 this.maxExtent = new Envelope(maxExtent); |
1774
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
242 return; |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
243 } |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
244 |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
245 this.maxExtent.expandToInclude(maxExtent); |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
246 } |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
247 |
9619 | 248 protected void setInitialExtent(final Envelope initialExtent) { |
2091
5d158f8ad080
#298 Fixed broken auto-zoom-to-wsplgen in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2082
diff
changeset
|
249 if (this.initialExtent == null && initialExtent != null) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7087
diff
changeset
|
250 log.debug("Set initial extent to: " + initialExtent); |
2091
5d158f8ad080
#298 Fixed broken auto-zoom-to-wsplgen in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2082
diff
changeset
|
251 this.initialExtent = new Envelope(initialExtent); |
1774
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
252 } |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
253 } |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
254 |
9619 | 255 protected void setSrid(final String srid) { |
1774
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
256 if (srid == null || srid.length() == 0) { |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
257 return; |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
258 } |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
259 |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
260 this.srid = srid; |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
261 } |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
262 |
9619 | 263 protected void appendMapInformation(final Element parent, final ElementCreator c) { |
8527
76a2268942c6
(issue1794) Safeguard against layers without extent.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8202
diff
changeset
|
264 String mE; |
76a2268942c6
(issue1794) Safeguard against layers without extent.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8202
diff
changeset
|
265 if (this.maxExtent != null) { |
76a2268942c6
(issue1794) Safeguard against layers without extent.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8202
diff
changeset
|
266 mE = GeometryUtils.jtsBoundsToOLBounds(this.maxExtent); |
76a2268942c6
(issue1794) Safeguard against layers without extent.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8202
diff
changeset
|
267 } else { |
76a2268942c6
(issue1794) Safeguard against layers without extent.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8202
diff
changeset
|
268 log.error("Layer without extent. Probably no geometry at all."); |
8746
e701ef544ffa
Avoid writing defect mapfiles for layers without extent.
Tom Gottfried <tom@intevation.de>
parents:
8527
diff
changeset
|
269 mE = "0 0 1 1"; |
8527
76a2268942c6
(issue1794) Safeguard against layers without extent.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8202
diff
changeset
|
270 } |
1774
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
271 |
9619 | 272 final Element maxExtent = c.create("maxExtent"); |
1774
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
273 maxExtent.setTextContent(mE); |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
274 |
9619 | 275 if (this.initialExtent != null) { |
276 final String iE = GeometryUtils.jtsBoundsToOLBounds(this.initialExtent); | |
277 final Element initExtent = c.create("initialExtent"); | |
2082
007a8f5ed9f1
Implemented new module "new map".
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2047
diff
changeset
|
278 initExtent.setTextContent(iE); |
007a8f5ed9f1
Implemented new module "new map".
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2047
diff
changeset
|
279 parent.appendChild(initExtent); |
007a8f5ed9f1
Implemented new module "new map".
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2047
diff
changeset
|
280 } |
1774
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
281 |
9619 | 282 final Element srid = c.create("srid"); |
1774
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
283 srid.setTextContent(this.srid); |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
284 |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
285 // TODO zoom levels |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
286 // TODO resolutation |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
287 |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
288 parent.appendChild(maxExtent); |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
289 parent.appendChild(srid); |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
290 } |
1979
a7c437c9547e
Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1944
diff
changeset
|
291 |
a7c437c9547e
Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1944
diff
changeset
|
292 /** |
a7c437c9547e
Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1944
diff
changeset
|
293 * Returns an instance of <i>EmptySettings</i> currently! |
a7c437c9547e
Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1944
diff
changeset
|
294 * |
a7c437c9547e
Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1944
diff
changeset
|
295 * @return an instance of <i>EmptySettings</i>. |
a7c437c9547e
Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1944
diff
changeset
|
296 */ |
2047
0318fa6f0844
Make use of first attributes specified in the ChartSettings. NOTE: work is still in progress.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1979
diff
changeset
|
297 @Override |
1979
a7c437c9547e
Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1944
diff
changeset
|
298 public Settings getSettings() { |
a7c437c9547e
Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1944
diff
changeset
|
299 return new EmptySettings(); |
a7c437c9547e
Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1944
diff
changeset
|
300 } |
2047
0318fa6f0844
Make use of first attributes specified in the ChartSettings. NOTE: work is still in progress.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1979
diff
changeset
|
301 |
0318fa6f0844
Make use of first attributes specified in the ChartSettings. NOTE: work is still in progress.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1979
diff
changeset
|
302 @Override |
9619 | 303 public void setSettings(final Settings settings) { |
2047
0318fa6f0844
Make use of first attributes specified in the ChartSettings. NOTE: work is still in progress.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1979
diff
changeset
|
304 this.settings = settings; |
0318fa6f0844
Make use of first attributes specified in the ChartSettings. NOTE: work is still in progress.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1979
diff
changeset
|
305 } |
1774
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
306 } |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
307 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |