Mercurial > dive4elements > gnv-client
annotate gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/context/GNVArtifactContextFactory.java @ 734:8f7fe0cc6e5a
Added Interface and Defaultimplementation for States which can be handled without any userinteraction.
gnv-artifacts/trunk@772 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Mon, 15 Mar 2010 12:39:35 +0000 |
parents | c8749d83d9b6 |
children | 9a828e5a2390 |
rev | line source |
---|---|
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.gnv.artifacts.context; |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
2 |
521
1bf058f1a2d1
Generate seabed polygon to "Profilschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
474
diff
changeset
|
3 import java.awt.Color; |
1bf058f1a2d1
Generate seabed polygon to "Profilschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
474
diff
changeset
|
4 import java.awt.Paint; |
1bf058f1a2d1
Generate seabed polygon to "Profilschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
474
diff
changeset
|
5 |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
6 import java.io.FileInputStream; |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
7 import java.io.FileNotFoundException; |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
8 import java.io.IOException; |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
9 import java.io.InputStream; |
369
77cd3a2bc381
Fixed file-leak bug and sourced xml parsing out to XMLUtils of artifactdatabase.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
358
diff
changeset
|
10 import java.io.File; |
77cd3a2bc381
Fixed file-leak bug and sourced xml parsing out to XMLUtils of artifactdatabase.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
358
diff
changeset
|
11 |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
12 import java.util.Properties; |
426
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
13 import java.util.HashMap; |
438
7399bb8f83ea
Added manager to handle several levels of palette subdivsions.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
426
diff
changeset
|
14 import java.util.ArrayList; |
444
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
15 import java.util.Collections; |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
16 |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
17 import java.awt.Dimension; |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
18 |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
19 import org.apache.log4j.Logger; |
426
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
20 |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
21 import org.w3c.dom.Document; |
426
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
22 import org.w3c.dom.Element; |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
23 import org.w3c.dom.NodeList; |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
24 |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
25 import de.intevation.gnv.geobackend.base.connectionpool.ConnectionPoolFactory; |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
26 |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
27 import de.intevation.gnv.geobackend.base.query.container.QueryContainerFactory; |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
28 import de.intevation.gnv.geobackend.base.query.container.exception.QueryContainerException; |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
29 |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
30 import de.intevation.gnv.chart.XMLChartTheme; |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
31 |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
32 import de.intevation.gnv.artifacts.cache.CacheFactory; |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
33 |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
34 import de.intevation.gnv.raster.Palette; |
444
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
35 import de.intevation.gnv.raster.Filter; |
438
7399bb8f83ea
Added manager to handle several levels of palette subdivsions.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
426
diff
changeset
|
36 import de.intevation.gnv.raster.PaletteManager; |
426
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
37 |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
38 import de.intevation.artifacts.ArtifactContextFactory; |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
39 |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
40 import de.intevation.artifactdatabase.Config; |
369
77cd3a2bc381
Fixed file-leak bug and sourced xml parsing out to XMLUtils of artifactdatabase.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
358
diff
changeset
|
41 import de.intevation.artifactdatabase.XMLUtils; |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
42 |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
43 /** |
442
52e031261eaa
Create a new 'gnv' section in config file.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
438
diff
changeset
|
44 * @author Tim Englich (tim.englich@intevation.de) |
52e031261eaa
Create a new 'gnv' section in config file.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
438
diff
changeset
|
45 * @author Ingo Weinzierl (iweinzierl@intevation.de) |
52e031261eaa
Create a new 'gnv' section in config file.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
438
diff
changeset
|
46 * @author Sascha L. Teichmann (sascha.teichmann@intevation.de) |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
47 */ |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
48 public class GNVArtifactContextFactory implements ArtifactContextFactory { |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
49 /** |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
50 * the logger, used to log exceptions and additonaly information |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
51 */ |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
52 private static Logger log = Logger.getLogger(GNVArtifactContext.class); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
53 |
426
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
54 public static final String XPATH_GEOBACKEND_CONFIGURATION = |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
55 "artifact-database/geo-backend/backend-configuration"; |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
56 |
426
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
57 public static final String XPATH_GEOBACKEND_QUERYCONFIGURATION = |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
58 "artifact-database/geo-backend/query-configuration"; |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
59 |
426
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
60 private final static String CACHECONFIGNODEPATH = |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
61 "/artifact-database/ehcache/configuration"; |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
62 |
426
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
63 private final static String CHARTCONFIGNODEPATH = |
442
52e031261eaa
Create a new 'gnv' section in config file.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
438
diff
changeset
|
64 "/artifact-database/gnv/charttemplate/configuration"; |
426
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
65 |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
66 public final static String PALETTES_PATH = |
442
52e031261eaa
Create a new 'gnv' section in config file.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
438
diff
changeset
|
67 "/artifact-database/gnv/palettes"; |
426
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
68 |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
69 public final static String PALETTE_ITEMS = |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
70 "palette"; |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
71 |
443
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
72 public final static String HORIZONTAL_CROSS_SECTION_PROFILE_SAMPLES = |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
73 "/artifact-database/gnv/horizontal-cross-section-profile/samples/@number"; |
358
2f7a28f211c7
Fetch ChartTheme from CallContext instead of creating it each time before creating a chart.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
203
diff
changeset
|
74 |
474
ab29e4ff2fda
Added area interpolation needed for "Horizontalschnitt"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
472
diff
changeset
|
75 public final static String HORIZONTAL_CROSS_SECTION_GROUND_INTERPOLATION = |
ab29e4ff2fda
Added area interpolation needed for "Horizontalschnitt"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
472
diff
changeset
|
76 "/artifact-database/gnv/horizontal-cross-section/ground/@interpolation"; |
ab29e4ff2fda
Added area interpolation needed for "Horizontalschnitt"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
472
diff
changeset
|
77 |
468
7ba4c7222265
Added ij-Index determination for horizontal-cross-sections.
Tim Englich <tim.englich@intevation.de>
parents:
463
diff
changeset
|
78 public final static String HORIZONTAL_CROSS_SECTION_SAMPLES = |
7ba4c7222265
Added ij-Index determination for horizontal-cross-sections.
Tim Englich <tim.englich@intevation.de>
parents:
463
diff
changeset
|
79 "/artifact-database/gnv/horizontal-cross-section/samples/@number"; |
7ba4c7222265
Added ij-Index determination for horizontal-cross-sections.
Tim Englich <tim.englich@intevation.de>
parents:
463
diff
changeset
|
80 |
593
b248531fa20b
Added experimental support for extrapolation in "Horizontalschnitte"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
521
diff
changeset
|
81 public final static String HORIZONTAL_CROSS_SECTION_EXTRAPOLATION_ROUNDS = |
b248531fa20b
Added experimental support for extrapolation in "Horizontalschnitte"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
521
diff
changeset
|
82 "/artifact-database/gnv/horizontal-cross-section/extrapolation/@rounds"; |
b248531fa20b
Added experimental support for extrapolation in "Horizontalschnitte"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
521
diff
changeset
|
83 |
472
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
84 public final static String HORIZONTAL_CROSS_SECTION_RESULT_SHAPEFILE_PATH = |
625
40ead2d2a08d
Restructured configuration, removed duplicated entry and store config information in MapfileGenerator to avoid reading config file every time while updating mapfile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
593
diff
changeset
|
85 "/artifact-database/gnv/shapefile-directory/@path"; |
472
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
86 |
444
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
87 public final static String VERTICAL_CROSS_SECTION_SAMPLES = |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
88 "/artifact-database/gnv/vertical-cross-section/samples"; |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
89 |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
90 public final static String VERTICAL_CROSS_SECTION_FILTERS = |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
91 "/artifact-database/gnv/vertical-cross-section/filters/filter"; |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
92 |
463
07672838fa5f
Make ground interpolation for vertical cross section configurable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
444
diff
changeset
|
93 public final static String VERTICAL_CROSS_SECTION_GROUND_INTERPOLATION = |
07672838fa5f
Make ground interpolation for vertical cross section configurable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
444
diff
changeset
|
94 "/artifact-database/gnv/vertical-cross-section/ground/@interpolation"; |
07672838fa5f
Make ground interpolation for vertical cross section configurable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
444
diff
changeset
|
95 |
521
1bf058f1a2d1
Generate seabed polygon to "Profilschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
474
diff
changeset
|
96 public final static String VERTICAL_CROSS_SECTION_GROUND_FILL_COLOR = |
1bf058f1a2d1
Generate seabed polygon to "Profilschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
474
diff
changeset
|
97 "/artifact-database/gnv/vertical-cross-section/ground/@fill-color"; |
1bf058f1a2d1
Generate seabed polygon to "Profilschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
474
diff
changeset
|
98 |
646
c8749d83d9b6
Added a configuration section for mapserver relevant stuff. Moved source to write meta files out to an own helper class named MetaWriter.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
630
diff
changeset
|
99 public final static String XPATH_MAPSERVER_PATH = |
c8749d83d9b6
Added a configuration section for mapserver relevant stuff. Moved source to write meta files out to an own helper class named MetaWriter.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
630
diff
changeset
|
100 "/artifact-database/mapserver/server/@path"; |
c8749d83d9b6
Added a configuration section for mapserver relevant stuff. Moved source to write meta files out to an own helper class named MetaWriter.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
630
diff
changeset
|
101 |
c8749d83d9b6
Added a configuration section for mapserver relevant stuff. Moved source to write meta files out to an own helper class named MetaWriter.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
630
diff
changeset
|
102 public final static String XPATH_MAP_PATH = |
c8749d83d9b6
Added a configuration section for mapserver relevant stuff. Moved source to write meta files out to an own helper class named MetaWriter.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
630
diff
changeset
|
103 "/artifact-database/mapserver/map/@path"; |
c8749d83d9b6
Added a configuration section for mapserver relevant stuff. Moved source to write meta files out to an own helper class named MetaWriter.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
630
diff
changeset
|
104 |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
105 /** |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
106 * Constructor |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
107 */ |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
108 public GNVArtifactContextFactory() { |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
109 super(); |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
110 log.debug("GNVArtifactContextFactory.Constructor"); |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
111 } |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
112 |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
113 /** |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
114 * @see de.intevation.artifacts.ArtifactContextFactory#createArtifactContext(org.w3c.dom.Document) |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
115 */ |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
116 public Object createArtifactContext(Document config) { |
358
2f7a28f211c7
Fetch ChartTheme from CallContext instead of creating it each time before creating a chart.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
203
diff
changeset
|
117 GNVArtifactContext returnValue = null; |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
118 try { |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
119 log.debug("GNVArtifactContextFactory.createArtifactContext"); |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
120 log.info("Initialisation of the Geo-BackendConnectionPool"); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
121 String backendConfigurationFile = Config.getStringXPath(config, |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
122 XPATH_GEOBACKEND_CONFIGURATION); |
426
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
123 backendConfigurationFile = Config.replaceConfigDir( |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
124 backendConfigurationFile); |
630
a72ecacccc91
Changed cache initialization so that we can use GNV without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
625
diff
changeset
|
125 |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
126 Properties properties = getProperties(backendConfigurationFile); |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
127 ConnectionPoolFactory cpf = ConnectionPoolFactory.getInstance(); |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
128 cpf.initializeConnectionPool(properties); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
129 |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
130 log.info("Initialisation of the QueryContainer"); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
131 String queryConfigurationFile = Config.getStringXPath(config, |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
132 XPATH_GEOBACKEND_QUERYCONFIGURATION); |
426
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
133 queryConfigurationFile = Config.replaceConfigDir( |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
134 queryConfigurationFile); |
630
a72ecacccc91
Changed cache initialization so that we can use GNV without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
625
diff
changeset
|
135 |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
136 Properties queryProperties = getProperties(queryConfigurationFile); |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
137 QueryContainerFactory qcf = QueryContainerFactory.getInstance(); |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
138 qcf.initializeQueryContainer(queryProperties); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
139 |
630
a72ecacccc91
Changed cache initialization so that we can use GNV without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
625
diff
changeset
|
140 configureCache(config); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
141 |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
142 returnValue = new GNVArtifactContext(config); |
358
2f7a28f211c7
Fetch ChartTheme from CallContext instead of creating it each time before creating a chart.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
203
diff
changeset
|
143 |
426
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
144 configurePalettes(config, returnValue); |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
145 |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
146 configureChartTemplate(config, returnValue); |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
147 |
443
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
148 configureHorizontalCrossSectionProfile(config, returnValue); |
426
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
149 |
468
7ba4c7222265
Added ij-Index determination for horizontal-cross-sections.
Tim Englich <tim.englich@intevation.de>
parents:
463
diff
changeset
|
150 configureHorizontalCrossSection(config,returnValue); |
7ba4c7222265
Added ij-Index determination for horizontal-cross-sections.
Tim Englich <tim.englich@intevation.de>
parents:
463
diff
changeset
|
151 |
444
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
152 configureVerticalCrossSection(config, returnValue); |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
153 |
646
c8749d83d9b6
Added a configuration section for mapserver relevant stuff. Moved source to write meta files out to an own helper class named MetaWriter.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
630
diff
changeset
|
154 configureMapserver(config, returnValue); |
c8749d83d9b6
Added a configuration section for mapserver relevant stuff. Moved source to write meta files out to an own helper class named MetaWriter.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
630
diff
changeset
|
155 |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
156 } catch (FileNotFoundException e) { |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
157 log.error(e, e); |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
158 } catch (IOException e) { |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
159 log.error(e, e); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
160 } catch (QueryContainerException e) { |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
161 log.error(e, e); |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
162 } |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
163 return returnValue; |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
164 } |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
165 |
444
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
166 protected void configureVerticalCrossSection( |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
167 Document config, |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
168 GNVArtifactContext context |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
169 ) { |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
170 log.info("configuration of vertical cross section"); |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
171 configureVerticalCrossSectionSamples(config, context); |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
172 configureVerticalCrossSectionFilters(config, context); |
463
07672838fa5f
Make ground interpolation for vertical cross section configurable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
444
diff
changeset
|
173 configureVerticalCrossSectionGroundInterpolation(config, context); |
521
1bf058f1a2d1
Generate seabed polygon to "Profilschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
474
diff
changeset
|
174 configureVerticalCrossSectionGroundFillColor(config, context); |
1bf058f1a2d1
Generate seabed polygon to "Profilschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
474
diff
changeset
|
175 } |
1bf058f1a2d1
Generate seabed polygon to "Profilschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
474
diff
changeset
|
176 |
630
a72ecacccc91
Changed cache initialization so that we can use GNV without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
625
diff
changeset
|
177 |
a72ecacccc91
Changed cache initialization so that we can use GNV without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
625
diff
changeset
|
178 protected void configureCache(Document config) { |
a72ecacccc91
Changed cache initialization so that we can use GNV without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
625
diff
changeset
|
179 String cacheConfigurationFile = Config.getStringXPath( |
a72ecacccc91
Changed cache initialization so that we can use GNV without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
625
diff
changeset
|
180 config, CACHECONFIGNODEPATH); |
a72ecacccc91
Changed cache initialization so that we can use GNV without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
625
diff
changeset
|
181 |
a72ecacccc91
Changed cache initialization so that we can use GNV without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
625
diff
changeset
|
182 if (cacheConfigurationFile != null |
a72ecacccc91
Changed cache initialization so that we can use GNV without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
625
diff
changeset
|
183 && !cacheConfigurationFile.equals("")) |
a72ecacccc91
Changed cache initialization so that we can use GNV without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
625
diff
changeset
|
184 { |
a72ecacccc91
Changed cache initialization so that we can use GNV without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
625
diff
changeset
|
185 log.info("Initialisation of the Cache"); |
a72ecacccc91
Changed cache initialization so that we can use GNV without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
625
diff
changeset
|
186 cacheConfigurationFile = Config.replaceConfigDir( |
a72ecacccc91
Changed cache initialization so that we can use GNV without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
625
diff
changeset
|
187 cacheConfigurationFile); |
a72ecacccc91
Changed cache initialization so that we can use GNV without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
625
diff
changeset
|
188 |
a72ecacccc91
Changed cache initialization so that we can use GNV without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
625
diff
changeset
|
189 CacheFactory cf = CacheFactory.getInstance(); |
a72ecacccc91
Changed cache initialization so that we can use GNV without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
625
diff
changeset
|
190 cf.initializeCache(cacheConfigurationFile); |
a72ecacccc91
Changed cache initialization so that we can use GNV without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
625
diff
changeset
|
191 } |
a72ecacccc91
Changed cache initialization so that we can use GNV without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
625
diff
changeset
|
192 } |
a72ecacccc91
Changed cache initialization so that we can use GNV without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
625
diff
changeset
|
193 |
521
1bf058f1a2d1
Generate seabed polygon to "Profilschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
474
diff
changeset
|
194 protected void configureVerticalCrossSectionGroundFillColor( |
1bf058f1a2d1
Generate seabed polygon to "Profilschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
474
diff
changeset
|
195 Document config, |
1bf058f1a2d1
Generate seabed polygon to "Profilschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
474
diff
changeset
|
196 GNVArtifactContext context |
1bf058f1a2d1
Generate seabed polygon to "Profilschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
474
diff
changeset
|
197 ) { |
1bf058f1a2d1
Generate seabed polygon to "Profilschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
474
diff
changeset
|
198 log.info("configuration of vertical cross section ground fill color"); |
1bf058f1a2d1
Generate seabed polygon to "Profilschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
474
diff
changeset
|
199 |
1bf058f1a2d1
Generate seabed polygon to "Profilschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
474
diff
changeset
|
200 String fillColor = Config.getStringXPath( |
1bf058f1a2d1
Generate seabed polygon to "Profilschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
474
diff
changeset
|
201 config, |
1bf058f1a2d1
Generate seabed polygon to "Profilschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
474
diff
changeset
|
202 VERTICAL_CROSS_SECTION_GROUND_FILL_COLOR); |
1bf058f1a2d1
Generate seabed polygon to "Profilschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
474
diff
changeset
|
203 |
1bf058f1a2d1
Generate seabed polygon to "Profilschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
474
diff
changeset
|
204 Paint fill = |
1bf058f1a2d1
Generate seabed polygon to "Profilschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
474
diff
changeset
|
205 GNVArtifactContext.DEFAULT_VERTICAL_CROSS_SECTION_GROUND_FILL; |
1bf058f1a2d1
Generate seabed polygon to "Profilschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
474
diff
changeset
|
206 |
1bf058f1a2d1
Generate seabed polygon to "Profilschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
474
diff
changeset
|
207 if (fillColor != null |
1bf058f1a2d1
Generate seabed polygon to "Profilschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
474
diff
changeset
|
208 && (fillColor = fillColor.trim()).length() != 0) { |
1bf058f1a2d1
Generate seabed polygon to "Profilschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
474
diff
changeset
|
209 try { |
1bf058f1a2d1
Generate seabed polygon to "Profilschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
474
diff
changeset
|
210 Color color = Color.decode(fillColor); |
1bf058f1a2d1
Generate seabed polygon to "Profilschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
474
diff
changeset
|
211 log.info("ground fill color: #" + |
1bf058f1a2d1
Generate seabed polygon to "Profilschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
474
diff
changeset
|
212 Integer.toHexString(color.getRGB())); |
1bf058f1a2d1
Generate seabed polygon to "Profilschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
474
diff
changeset
|
213 fill = color; |
1bf058f1a2d1
Generate seabed polygon to "Profilschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
474
diff
changeset
|
214 } |
1bf058f1a2d1
Generate seabed polygon to "Profilschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
474
diff
changeset
|
215 catch (NumberFormatException nfe) { |
1bf058f1a2d1
Generate seabed polygon to "Profilschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
474
diff
changeset
|
216 log.error("'" + fillColor + "' is not a valid color"); |
1bf058f1a2d1
Generate seabed polygon to "Profilschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
474
diff
changeset
|
217 } |
1bf058f1a2d1
Generate seabed polygon to "Profilschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
474
diff
changeset
|
218 } |
1bf058f1a2d1
Generate seabed polygon to "Profilschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
474
diff
changeset
|
219 |
1bf058f1a2d1
Generate seabed polygon to "Profilschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
474
diff
changeset
|
220 context.put( |
1bf058f1a2d1
Generate seabed polygon to "Profilschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
474
diff
changeset
|
221 GNVArtifactContext |
1bf058f1a2d1
Generate seabed polygon to "Profilschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
474
diff
changeset
|
222 .VERTICAL_CROSS_SECTION_GROUND_FILL_KEY, |
1bf058f1a2d1
Generate seabed polygon to "Profilschnitte".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
474
diff
changeset
|
223 fill); |
463
07672838fa5f
Make ground interpolation for vertical cross section configurable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
444
diff
changeset
|
224 } |
07672838fa5f
Make ground interpolation for vertical cross section configurable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
444
diff
changeset
|
225 |
07672838fa5f
Make ground interpolation for vertical cross section configurable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
444
diff
changeset
|
226 protected void configureVerticalCrossSectionGroundInterpolation( |
07672838fa5f
Make ground interpolation for vertical cross section configurable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
444
diff
changeset
|
227 Document config, |
07672838fa5f
Make ground interpolation for vertical cross section configurable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
444
diff
changeset
|
228 GNVArtifactContext context |
07672838fa5f
Make ground interpolation for vertical cross section configurable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
444
diff
changeset
|
229 ) { |
07672838fa5f
Make ground interpolation for vertical cross section configurable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
444
diff
changeset
|
230 log.info("configuration of vertical cross section ground interpolation"); |
07672838fa5f
Make ground interpolation for vertical cross section configurable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
444
diff
changeset
|
231 String interpolation = Config.getStringXPath( |
07672838fa5f
Make ground interpolation for vertical cross section configurable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
444
diff
changeset
|
232 config, |
07672838fa5f
Make ground interpolation for vertical cross section configurable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
444
diff
changeset
|
233 VERTICAL_CROSS_SECTION_GROUND_INTERPOLATION); |
07672838fa5f
Make ground interpolation for vertical cross section configurable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
444
diff
changeset
|
234 |
07672838fa5f
Make ground interpolation for vertical cross section configurable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
444
diff
changeset
|
235 if (interpolation == null |
07672838fa5f
Make ground interpolation for vertical cross section configurable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
444
diff
changeset
|
236 || (interpolation = interpolation.trim()).length() == 0) { |
07672838fa5f
Make ground interpolation for vertical cross section configurable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
444
diff
changeset
|
237 interpolation = GNVArtifactContext |
07672838fa5f
Make ground interpolation for vertical cross section configurable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
444
diff
changeset
|
238 .DEFAULT_VERTICAL_CROSS_SECTION_GROUND_INTERPOLATION; |
07672838fa5f
Make ground interpolation for vertical cross section configurable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
444
diff
changeset
|
239 } |
07672838fa5f
Make ground interpolation for vertical cross section configurable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
444
diff
changeset
|
240 |
07672838fa5f
Make ground interpolation for vertical cross section configurable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
444
diff
changeset
|
241 log.info("ground interpolation: " + interpolation); |
07672838fa5f
Make ground interpolation for vertical cross section configurable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
444
diff
changeset
|
242 |
07672838fa5f
Make ground interpolation for vertical cross section configurable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
444
diff
changeset
|
243 context.put( |
07672838fa5f
Make ground interpolation for vertical cross section configurable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
444
diff
changeset
|
244 GNVArtifactContext |
07672838fa5f
Make ground interpolation for vertical cross section configurable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
444
diff
changeset
|
245 .VERTICAL_CROSS_SECTION_GROUND_INTERPOLATION_KEY, |
07672838fa5f
Make ground interpolation for vertical cross section configurable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
444
diff
changeset
|
246 interpolation); |
444
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
247 } |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
248 |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
249 protected void configureVerticalCrossSectionFilters( |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
250 Document config, |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
251 GNVArtifactContext context |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
252 ) { |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
253 log.info("configuration of vertical cross section filters"); |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
254 |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
255 NodeList filters = Config.getNodeSetXPath( |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
256 VERTICAL_CROSS_SECTION_FILTERS); |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
257 |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
258 ArrayList<Filter.Factory> filterFactories = |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
259 new ArrayList<Filter.Factory>(); |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
260 |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
261 if (filters == null) { |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
262 log.warn("no filters found"); |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
263 } |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
264 else { |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
265 for (int i = 0, N = filters.getLength(); i < N; ++i) { |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
266 Element filterElement = (Element)filters.item(i); |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
267 String factoryName = filterElement.getAttribute("factory"); |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
268 if ((factoryName = factoryName.trim()).length() > 0) { |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
269 try { |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
270 Class clazz = Class.forName(factoryName); |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
271 Filter.Factory filterFactory = |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
272 (Filter.Factory)clazz.newInstance(); |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
273 filterFactories.add(filterFactory); |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
274 } |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
275 catch (ClassNotFoundException cnfe) { |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
276 log.error("filter class not found", cnfe); |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
277 } |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
278 catch (InstantiationException ie) { |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
279 log.error("cannot instantiate filter factory", ie); |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
280 } |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
281 catch (IllegalAccessException iae) { |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
282 log.error("cannot access filter factory", iae); |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
283 } |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
284 catch (ClassCastException cce) { |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
285 log.error("not a filter factory class", cce); |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
286 } |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
287 } |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
288 else { |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
289 log.error("No factory name given"); |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
290 } |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
291 } |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
292 } |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
293 |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
294 log.info("number of filters: " + filterFactories.size()); |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
295 |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
296 context.put( |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
297 GNVArtifactContext.VERTICAL_CROSS_SECTION_FILTER_FACTORIES_KEY, |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
298 Collections.unmodifiableList(filterFactories)); |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
299 } |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
300 |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
301 protected void configureVerticalCrossSectionSamples( |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
302 Document config, |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
303 GNVArtifactContext context |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
304 ) { |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
305 log.info("configuration of vertical cross section samples"); |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
306 |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
307 Element samples = (Element)Config.getNodeXPath( |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
308 VERTICAL_CROSS_SECTION_SAMPLES); |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
309 |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
310 Dimension sampleSize = new Dimension( |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
311 GNVArtifactContext.DEFAULT_VERTICAL_CROSS_SECTION_SAMPLES); |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
312 |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
313 if (samples == null) { |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
314 log.warn("no samples found"); |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
315 } |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
316 else { |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
317 String widthString = samples.getAttribute("width"); |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
318 if ((widthString = widthString.trim()).length() > 0) { |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
319 try { |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
320 sampleSize.width = Math.max(1, Integer.parseInt(widthString)); |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
321 } |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
322 catch (NumberFormatException nfe) { |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
323 log.error("invalid value for width: '" + widthString + "'"); |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
324 } |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
325 } |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
326 String heightString = samples.getAttribute("height"); |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
327 if ((heightString = heightString.trim()).length() > 0) { |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
328 try { |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
329 sampleSize.height = Math.max(1, Integer.parseInt(heightString)); |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
330 } |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
331 catch (NumberFormatException nfe) { |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
332 log.error("invalid value for height: '" + heightString + "'"); |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
333 } |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
334 } |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
335 } |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
336 log.info("samples (width x height): " + |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
337 sampleSize.width + " x " + sampleSize.height); |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
338 |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
339 context.put( |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
340 GNVArtifactContext.VERTICAL_CROSS_SECTION_SAMPLES_KEY, |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
341 sampleSize); |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
342 |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
343 } |
85f48e287fb3
Added configuration for vertical cross sections ("Profilschnitte")
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
443
diff
changeset
|
344 |
443
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
345 protected void configureHorizontalCrossSectionProfile( |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
346 Document config, |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
347 GNVArtifactContext context |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
348 ) |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
349 { |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
350 log.info("configuration of horizontal cross section profile"); |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
351 |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
352 String numSamples = Config.getStringXPath( |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
353 config, |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
354 HORIZONTAL_CROSS_SECTION_PROFILE_SAMPLES); |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
355 |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
356 Integer samples = |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
357 GNVArtifactContext.DEFAULT_HORIZONTAL_CROSS_SECTION_PROFILE_SAMPLES; |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
358 |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
359 if (numSamples == null) { |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
360 log.warn("No number of samples found."); |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
361 } |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
362 else { |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
363 try { |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
364 samples = Integer.valueOf(numSamples); |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
365 } |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
366 catch (NumberFormatException nfe) { |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
367 log.warn("Invalid integer for number of samples"); |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
368 } |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
369 } |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
370 |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
371 log.info("# horizontal cross section profile samples: " + samples); |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
372 |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
373 context.put( |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
374 GNVArtifactContext.HORIZONTAL_CROSS_SECTION_PROFILE_SAMPLES_KEY, |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
375 samples); |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
376 } |
468
7ba4c7222265
Added ij-Index determination for horizontal-cross-sections.
Tim Englich <tim.englich@intevation.de>
parents:
463
diff
changeset
|
377 |
7ba4c7222265
Added ij-Index determination for horizontal-cross-sections.
Tim Englich <tim.englich@intevation.de>
parents:
463
diff
changeset
|
378 protected void configureHorizontalCrossSection( |
472
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
379 Document config, |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
380 GNVArtifactContext context |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
381 ) { |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
382 log.info("configuration of horizontal cross section"); |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
383 |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
384 configureHorizontalCrossSectionSamples(config, context); |
593
b248531fa20b
Added experimental support for extrapolation in "Horizontalschnitte"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
521
diff
changeset
|
385 configureHorizontalCrossSectionExtrapolation(config, context); |
472
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
386 configureHorizontalCrossSectionResultShapeFilePath(config, context); |
474
ab29e4ff2fda
Added area interpolation needed for "Horizontalschnitt"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
472
diff
changeset
|
387 configureHorizontalCrossSectionGroundInterpolation(config, context); |
ab29e4ff2fda
Added area interpolation needed for "Horizontalschnitt"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
472
diff
changeset
|
388 } |
ab29e4ff2fda
Added area interpolation needed for "Horizontalschnitt"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
472
diff
changeset
|
389 |
593
b248531fa20b
Added experimental support for extrapolation in "Horizontalschnitte"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
521
diff
changeset
|
390 protected void configureHorizontalCrossSectionExtrapolation( |
b248531fa20b
Added experimental support for extrapolation in "Horizontalschnitte"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
521
diff
changeset
|
391 Document config, |
b248531fa20b
Added experimental support for extrapolation in "Horizontalschnitte"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
521
diff
changeset
|
392 GNVArtifactContext context |
b248531fa20b
Added experimental support for extrapolation in "Horizontalschnitte"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
521
diff
changeset
|
393 ) |
b248531fa20b
Added experimental support for extrapolation in "Horizontalschnitte"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
521
diff
changeset
|
394 { |
b248531fa20b
Added experimental support for extrapolation in "Horizontalschnitte"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
521
diff
changeset
|
395 log.info( |
b248531fa20b
Added experimental support for extrapolation in "Horizontalschnitte"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
521
diff
changeset
|
396 "configuration of horizontal cross section extrapolation"); |
b248531fa20b
Added experimental support for extrapolation in "Horizontalschnitte"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
521
diff
changeset
|
397 |
b248531fa20b
Added experimental support for extrapolation in "Horizontalschnitte"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
521
diff
changeset
|
398 String extrapolationRoundsValue = Config.getStringXPath( |
b248531fa20b
Added experimental support for extrapolation in "Horizontalschnitte"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
521
diff
changeset
|
399 config, |
b248531fa20b
Added experimental support for extrapolation in "Horizontalschnitte"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
521
diff
changeset
|
400 HORIZONTAL_CROSS_SECTION_EXTRAPOLATION_ROUNDS); |
b248531fa20b
Added experimental support for extrapolation in "Horizontalschnitte"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
521
diff
changeset
|
401 |
b248531fa20b
Added experimental support for extrapolation in "Horizontalschnitte"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
521
diff
changeset
|
402 Integer extrapolationRounds = |
b248531fa20b
Added experimental support for extrapolation in "Horizontalschnitte"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
521
diff
changeset
|
403 GNVArtifactContext.DEFAULT_HORIZONTAL_CROSS_SECTION_EXTRAPOLATION_ROUNDS; |
b248531fa20b
Added experimental support for extrapolation in "Horizontalschnitte"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
521
diff
changeset
|
404 |
b248531fa20b
Added experimental support for extrapolation in "Horizontalschnitte"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
521
diff
changeset
|
405 if (extrapolationRoundsValue != null |
b248531fa20b
Added experimental support for extrapolation in "Horizontalschnitte"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
521
diff
changeset
|
406 && (extrapolationRoundsValue = extrapolationRoundsValue.trim()).length() > 0 |
b248531fa20b
Added experimental support for extrapolation in "Horizontalschnitte"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
521
diff
changeset
|
407 ) { |
b248531fa20b
Added experimental support for extrapolation in "Horizontalschnitte"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
521
diff
changeset
|
408 try { |
b248531fa20b
Added experimental support for extrapolation in "Horizontalschnitte"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
521
diff
changeset
|
409 extrapolationRounds = |
b248531fa20b
Added experimental support for extrapolation in "Horizontalschnitte"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
521
diff
changeset
|
410 Integer.valueOf(extrapolationRoundsValue); |
b248531fa20b
Added experimental support for extrapolation in "Horizontalschnitte"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
521
diff
changeset
|
411 } |
b248531fa20b
Added experimental support for extrapolation in "Horizontalschnitte"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
521
diff
changeset
|
412 catch (NumberFormatException nfe) { |
b248531fa20b
Added experimental support for extrapolation in "Horizontalschnitte"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
521
diff
changeset
|
413 log.error( |
b248531fa20b
Added experimental support for extrapolation in "Horizontalschnitte"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
521
diff
changeset
|
414 "'" + extrapolationRoundsValue + "' is not a valid integer"); |
b248531fa20b
Added experimental support for extrapolation in "Horizontalschnitte"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
521
diff
changeset
|
415 } |
b248531fa20b
Added experimental support for extrapolation in "Horizontalschnitte"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
521
diff
changeset
|
416 } |
b248531fa20b
Added experimental support for extrapolation in "Horizontalschnitte"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
521
diff
changeset
|
417 |
b248531fa20b
Added experimental support for extrapolation in "Horizontalschnitte"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
521
diff
changeset
|
418 log.info("extrapolation rounds: " + extrapolationRounds); |
b248531fa20b
Added experimental support for extrapolation in "Horizontalschnitte"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
521
diff
changeset
|
419 |
b248531fa20b
Added experimental support for extrapolation in "Horizontalschnitte"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
521
diff
changeset
|
420 context.put( |
b248531fa20b
Added experimental support for extrapolation in "Horizontalschnitte"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
521
diff
changeset
|
421 GNVArtifactContext |
b248531fa20b
Added experimental support for extrapolation in "Horizontalschnitte"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
521
diff
changeset
|
422 .HORIZONTAL_CROSS_SECTION_EXTRAPOLATION_ROUNDS_KEY, |
b248531fa20b
Added experimental support for extrapolation in "Horizontalschnitte"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
521
diff
changeset
|
423 extrapolationRounds); |
b248531fa20b
Added experimental support for extrapolation in "Horizontalschnitte"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
521
diff
changeset
|
424 } |
b248531fa20b
Added experimental support for extrapolation in "Horizontalschnitte"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
521
diff
changeset
|
425 |
474
ab29e4ff2fda
Added area interpolation needed for "Horizontalschnitt"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
472
diff
changeset
|
426 protected void configureHorizontalCrossSectionGroundInterpolation( |
ab29e4ff2fda
Added area interpolation needed for "Horizontalschnitt"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
472
diff
changeset
|
427 Document config, |
ab29e4ff2fda
Added area interpolation needed for "Horizontalschnitt"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
472
diff
changeset
|
428 GNVArtifactContext context |
ab29e4ff2fda
Added area interpolation needed for "Horizontalschnitt"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
472
diff
changeset
|
429 ) |
ab29e4ff2fda
Added area interpolation needed for "Horizontalschnitt"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
472
diff
changeset
|
430 { |
ab29e4ff2fda
Added area interpolation needed for "Horizontalschnitt"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
472
diff
changeset
|
431 log.info( |
ab29e4ff2fda
Added area interpolation needed for "Horizontalschnitt"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
472
diff
changeset
|
432 "configuration of horizontal cross section ground interpolation"); |
ab29e4ff2fda
Added area interpolation needed for "Horizontalschnitt"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
472
diff
changeset
|
433 |
ab29e4ff2fda
Added area interpolation needed for "Horizontalschnitt"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
472
diff
changeset
|
434 String interpolation = Config.getStringXPath( |
ab29e4ff2fda
Added area interpolation needed for "Horizontalschnitt"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
472
diff
changeset
|
435 config, |
ab29e4ff2fda
Added area interpolation needed for "Horizontalschnitt"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
472
diff
changeset
|
436 HORIZONTAL_CROSS_SECTION_GROUND_INTERPOLATION); |
ab29e4ff2fda
Added area interpolation needed for "Horizontalschnitt"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
472
diff
changeset
|
437 |
ab29e4ff2fda
Added area interpolation needed for "Horizontalschnitt"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
472
diff
changeset
|
438 if (interpolation == null |
ab29e4ff2fda
Added area interpolation needed for "Horizontalschnitt"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
472
diff
changeset
|
439 || (interpolation = interpolation.trim()).length() == 0) { |
ab29e4ff2fda
Added area interpolation needed for "Horizontalschnitt"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
472
diff
changeset
|
440 interpolation = GNVArtifactContext |
ab29e4ff2fda
Added area interpolation needed for "Horizontalschnitt"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
472
diff
changeset
|
441 .DEFAULT_HORIZONTAL_CROSS_SECTION_GROUND_INTERPOLATION; |
ab29e4ff2fda
Added area interpolation needed for "Horizontalschnitt"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
472
diff
changeset
|
442 } |
ab29e4ff2fda
Added area interpolation needed for "Horizontalschnitt"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
472
diff
changeset
|
443 |
ab29e4ff2fda
Added area interpolation needed for "Horizontalschnitt"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
472
diff
changeset
|
444 log.info("ground interpolation: " + interpolation); |
ab29e4ff2fda
Added area interpolation needed for "Horizontalschnitt"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
472
diff
changeset
|
445 |
ab29e4ff2fda
Added area interpolation needed for "Horizontalschnitt"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
472
diff
changeset
|
446 context.put( |
ab29e4ff2fda
Added area interpolation needed for "Horizontalschnitt"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
472
diff
changeset
|
447 GNVArtifactContext |
ab29e4ff2fda
Added area interpolation needed for "Horizontalschnitt"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
472
diff
changeset
|
448 .HORIZONTAL_CROSS_SECTION_GROUND_INTERPOLATION_KEY, |
ab29e4ff2fda
Added area interpolation needed for "Horizontalschnitt"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
472
diff
changeset
|
449 interpolation); |
472
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
450 } |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
451 |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
452 protected void configureHorizontalCrossSectionResultShapeFilePath( |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
453 Document config, |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
454 GNVArtifactContext context |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
455 ) |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
456 { |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
457 log.info( |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
458 "configuration of horizontal cross section result shape file path"); |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
459 |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
460 File dir = |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
461 GNVArtifactContext. |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
462 DEFAULT_HORIZONTAL_CROSS_SECTION_PROFILE_SHAPEFILE_PATH; |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
463 |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
464 String path = Config.getStringXPath( |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
465 config, |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
466 HORIZONTAL_CROSS_SECTION_RESULT_SHAPEFILE_PATH); |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
467 |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
468 if (path != null && (path = path.trim()).length() > 0) { |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
469 dir = new File(Config.replaceConfigDir(path)); |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
470 } |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
471 else { |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
472 log.warn("No 'result-shapefile-directory' given"); |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
473 } |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
474 |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
475 log.info("writing shape files to '" |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
476 + dir.getAbsolutePath() + "'"); |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
477 |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
478 context.put( |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
479 GNVArtifactContext |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
480 .HORIZONTAL_CROSS_SECTION_RESULT_SHAPEFILE_PATH_KEY, |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
481 dir); |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
482 } |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
483 |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
484 protected void configureHorizontalCrossSectionSamples( |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
485 Document config, |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
486 GNVArtifactContext context |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
487 ) |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
488 { |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
489 log.info("configuration of horizontal cross section samples"); |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
490 String numSamples = Config.getStringXPath( |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
491 config, |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
492 HORIZONTAL_CROSS_SECTION_SAMPLES); |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
493 |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
494 Integer samples = |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
495 GNVArtifactContext.DEFAULT_HORIZONTAL_CROSS_SECTION_SAMPLES; |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
496 |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
497 if (numSamples == null) { |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
498 log.warn("No number of samples found."); |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
499 } |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
500 else { |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
501 try { |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
502 samples = Integer.valueOf(numSamples); |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
503 } |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
504 catch (NumberFormatException nfe) { |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
505 log.warn("Invalid integer for number of samples"); |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
506 } |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
507 } |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
508 |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
509 log.info("# horizontal cross section profile samples: " + samples); |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
510 |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
511 context.put( |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
512 GNVArtifactContext.HORIZONTAL_CROSS_SECTION_SAMPLES_KEY, |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
513 samples); |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
514 } |
d6a100d5f74a
Added configuration of directory of "Horizontalschnitt" shape files.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
468
diff
changeset
|
515 |
443
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
516 |
426
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
517 protected void configureChartTemplate( |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
518 Document config, |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
519 GNVArtifactContext context |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
520 ) { |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
521 log.info("Initialisation of chart template"); |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
522 String chartConfigFile = Config.getStringXPath( |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
523 config, CHARTCONFIGNODEPATH |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
524 ); |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
525 |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
526 XMLChartTheme theme = new XMLChartTheme("XMLChartTheme"); |
443
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
527 |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
528 if (chartConfigFile == null) { |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
529 log.warn("no configuration file for chart template found"); |
426
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
530 } |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
531 else { |
443
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
532 chartConfigFile = Config.replaceConfigDir(chartConfigFile); |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
533 log.debug("Parse xml configuration of " + chartConfigFile); |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
534 |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
535 Document tmpl = XMLUtils.parseDocument(new File(chartConfigFile)); |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
536 if (tmpl != null) { |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
537 theme.applyXMLConfiguration(tmpl); |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
538 } |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
539 else { |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
540 log.error( |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
541 "Cannot load chart template from '" + |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
542 chartConfigFile + "'"); |
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
543 } |
426
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
544 } |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
545 |
443
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
546 context.put(GNVArtifactContext.CHART_TEMPLATE_KEY, theme); |
426
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
547 } |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
548 |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
549 protected void configurePalettes( |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
550 Document config, |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
551 GNVArtifactContext context |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
552 ) { |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
553 log.info("configure palettes"); |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
554 |
438
7399bb8f83ea
Added manager to handle several levels of palette subdivsions.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
426
diff
changeset
|
555 HashMap<Integer, PaletteManager> palettes = new HashMap(); |
426
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
556 |
442
52e031261eaa
Create a new 'gnv' section in config file.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
438
diff
changeset
|
557 Element node = (Element)Config.getNodeXPath(config, PALETTES_PATH); |
426
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
558 |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
559 if (node == null) { |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
560 log.error("No palettes found"); |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
561 } |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
562 else { |
442
52e031261eaa
Create a new 'gnv' section in config file.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
438
diff
changeset
|
563 NodeList pals = node.getElementsByTagName(PALETTE_ITEMS); |
52e031261eaa
Create a new 'gnv' section in config file.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
438
diff
changeset
|
564 for (int i = 0, N = pals==null?0:pals.getLength(); i < N; ++i) { |
426
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
565 Element pal = (Element)pals.item(i); |
438
7399bb8f83ea
Added manager to handle several levels of palette subdivsions.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
426
diff
changeset
|
566 String name = pal.getAttribute("name"); |
7399bb8f83ea
Added manager to handle several levels of palette subdivsions.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
426
diff
changeset
|
567 String description = pal.getAttribute("description"); |
7399bb8f83ea
Added manager to handle several levels of palette subdivsions.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
426
diff
changeset
|
568 String filename = pal.getAttribute("file"); |
7399bb8f83ea
Added manager to handle several levels of palette subdivsions.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
426
diff
changeset
|
569 String parameterIds = pal.getAttribute("parameter-ids"); |
426
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
570 |
438
7399bb8f83ea
Added manager to handle several levels of palette subdivsions.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
426
diff
changeset
|
571 if (name == null || (name = name.trim()).length() == 0) { |
426
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
572 log.error("Palette has no 'name' attribute."); |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
573 } |
438
7399bb8f83ea
Added manager to handle several levels of palette subdivsions.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
426
diff
changeset
|
574 else if (filename == null |
7399bb8f83ea
Added manager to handle several levels of palette subdivsions.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
426
diff
changeset
|
575 || (filename = filename.trim()).length() == 0) { |
7399bb8f83ea
Added manager to handle several levels of palette subdivsions.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
426
diff
changeset
|
576 log.error("Palette '" + name + "' has no 'file' attribute."); |
7399bb8f83ea
Added manager to handle several levels of palette subdivsions.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
426
diff
changeset
|
577 } |
7399bb8f83ea
Added manager to handle several levels of palette subdivsions.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
426
diff
changeset
|
578 else if (parameterIds == null |
7399bb8f83ea
Added manager to handle several levels of palette subdivsions.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
426
diff
changeset
|
579 || (parameterIds = parameterIds.trim()).length() == 0) { |
7399bb8f83ea
Added manager to handle several levels of palette subdivsions.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
426
diff
changeset
|
580 log.error("no parameter ids given for '" + name + "'"); |
426
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
581 } |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
582 else { |
438
7399bb8f83ea
Added manager to handle several levels of palette subdivsions.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
426
diff
changeset
|
583 ArrayList<Integer> ids = new ArrayList<Integer>(); |
7399bb8f83ea
Added manager to handle several levels of palette subdivsions.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
426
diff
changeset
|
584 for (String idString: parameterIds.split("[\t ,]+")) { |
7399bb8f83ea
Added manager to handle several levels of palette subdivsions.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
426
diff
changeset
|
585 try { |
7399bb8f83ea
Added manager to handle several levels of palette subdivsions.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
426
diff
changeset
|
586 ids.add(Integer.valueOf(idString)); |
7399bb8f83ea
Added manager to handle several levels of palette subdivsions.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
426
diff
changeset
|
587 } |
7399bb8f83ea
Added manager to handle several levels of palette subdivsions.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
426
diff
changeset
|
588 catch (NumberFormatException nfe) { |
7399bb8f83ea
Added manager to handle several levels of palette subdivsions.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
426
diff
changeset
|
589 log.error( |
7399bb8f83ea
Added manager to handle several levels of palette subdivsions.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
426
diff
changeset
|
590 "parameter id '" + idString + "' is integer"); |
7399bb8f83ea
Added manager to handle several levels of palette subdivsions.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
426
diff
changeset
|
591 } |
7399bb8f83ea
Added manager to handle several levels of palette subdivsions.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
426
diff
changeset
|
592 } |
426
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
593 filename = Config.replaceConfigDir(filename); |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
594 Document document = XMLUtils.parseDocument( |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
595 new File(filename)); |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
596 if (document == null) { |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
597 log.error("Cannot load palette file '" + |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
598 filename + "'"); |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
599 } |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
600 else { |
438
7399bb8f83ea
Added manager to handle several levels of palette subdivsions.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
426
diff
changeset
|
601 PaletteManager manager = new PaletteManager( |
7399bb8f83ea
Added manager to handle several levels of palette subdivsions.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
426
diff
changeset
|
602 name, |
7399bb8f83ea
Added manager to handle several levels of palette subdivsions.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
426
diff
changeset
|
603 description, |
7399bb8f83ea
Added manager to handle several levels of palette subdivsions.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
426
diff
changeset
|
604 new Palette(document)); |
7399bb8f83ea
Added manager to handle several levels of palette subdivsions.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
426
diff
changeset
|
605 for (Integer id: ids) { |
7399bb8f83ea
Added manager to handle several levels of palette subdivsions.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
426
diff
changeset
|
606 palettes.put(id, manager); |
7399bb8f83ea
Added manager to handle several levels of palette subdivsions.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
426
diff
changeset
|
607 } |
426
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
608 } |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
609 } |
438
7399bb8f83ea
Added manager to handle several levels of palette subdivsions.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
426
diff
changeset
|
610 } // for all palettes |
426
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
611 } |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
612 |
443
da21c256a0ba
"horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
442
diff
changeset
|
613 context.put(GNVArtifactContext.PALETTES_KEY, palettes); |
426
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
614 } |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
615 |
646
c8749d83d9b6
Added a configuration section for mapserver relevant stuff. Moved source to write meta files out to an own helper class named MetaWriter.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
630
diff
changeset
|
616 |
c8749d83d9b6
Added a configuration section for mapserver relevant stuff. Moved source to write meta files out to an own helper class named MetaWriter.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
630
diff
changeset
|
617 protected void configureMapserver( |
c8749d83d9b6
Added a configuration section for mapserver relevant stuff. Moved source to write meta files out to an own helper class named MetaWriter.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
630
diff
changeset
|
618 Document config, |
c8749d83d9b6
Added a configuration section for mapserver relevant stuff. Moved source to write meta files out to an own helper class named MetaWriter.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
630
diff
changeset
|
619 GNVArtifactContext context |
c8749d83d9b6
Added a configuration section for mapserver relevant stuff. Moved source to write meta files out to an own helper class named MetaWriter.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
630
diff
changeset
|
620 ) { |
c8749d83d9b6
Added a configuration section for mapserver relevant stuff. Moved source to write meta files out to an own helper class named MetaWriter.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
630
diff
changeset
|
621 log.info("read configuration of mapserver."); |
c8749d83d9b6
Added a configuration section for mapserver relevant stuff. Moved source to write meta files out to an own helper class named MetaWriter.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
630
diff
changeset
|
622 |
c8749d83d9b6
Added a configuration section for mapserver relevant stuff. Moved source to write meta files out to an own helper class named MetaWriter.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
630
diff
changeset
|
623 String serverPath = (String) Config.getStringXPath( |
c8749d83d9b6
Added a configuration section for mapserver relevant stuff. Moved source to write meta files out to an own helper class named MetaWriter.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
630
diff
changeset
|
624 config, XPATH_MAPSERVER_PATH); |
c8749d83d9b6
Added a configuration section for mapserver relevant stuff. Moved source to write meta files out to an own helper class named MetaWriter.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
630
diff
changeset
|
625 |
c8749d83d9b6
Added a configuration section for mapserver relevant stuff. Moved source to write meta files out to an own helper class named MetaWriter.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
630
diff
changeset
|
626 String mapPath = (String) Config.getStringXPath( |
c8749d83d9b6
Added a configuration section for mapserver relevant stuff. Moved source to write meta files out to an own helper class named MetaWriter.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
630
diff
changeset
|
627 config, XPATH_MAP_PATH); |
c8749d83d9b6
Added a configuration section for mapserver relevant stuff. Moved source to write meta files out to an own helper class named MetaWriter.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
630
diff
changeset
|
628 |
c8749d83d9b6
Added a configuration section for mapserver relevant stuff. Moved source to write meta files out to an own helper class named MetaWriter.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
630
diff
changeset
|
629 if (serverPath != null && mapPath != null) { |
c8749d83d9b6
Added a configuration section for mapserver relevant stuff. Moved source to write meta files out to an own helper class named MetaWriter.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
630
diff
changeset
|
630 context.put(GNVArtifactContext.MAPSERVER_SERVER_PATH_KEY,serverPath); |
c8749d83d9b6
Added a configuration section for mapserver relevant stuff. Moved source to write meta files out to an own helper class named MetaWriter.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
630
diff
changeset
|
631 context.put(GNVArtifactContext.MAPSERVER_MAP_PATH_KEY, mapPath); |
c8749d83d9b6
Added a configuration section for mapserver relevant stuff. Moved source to write meta files out to an own helper class named MetaWriter.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
630
diff
changeset
|
632 } |
c8749d83d9b6
Added a configuration section for mapserver relevant stuff. Moved source to write meta files out to an own helper class named MetaWriter.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
630
diff
changeset
|
633 } |
c8749d83d9b6
Added a configuration section for mapserver relevant stuff. Moved source to write meta files out to an own helper class named MetaWriter.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
630
diff
changeset
|
634 |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
635 /** |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
636 * @param filePath |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
637 * @return |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
638 * @throws FileNotFoundException |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
639 * @throws IOException |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
640 */ |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
641 private Properties getProperties(String filePath) |
426
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
642 throws FileNotFoundException, IOException |
3a0c0ad113d9
Load palettes from configuration.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
369
diff
changeset
|
643 { |
172
b5e55f460f0b
Closed small file descriptor leak in loading SQL properties file.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
171
diff
changeset
|
644 InputStream inputStream = null; |
b5e55f460f0b
Closed small file descriptor leak in loading SQL properties file.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
171
diff
changeset
|
645 try { |
b5e55f460f0b
Closed small file descriptor leak in loading SQL properties file.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
171
diff
changeset
|
646 inputStream = new FileInputStream(filePath); |
b5e55f460f0b
Closed small file descriptor leak in loading SQL properties file.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
171
diff
changeset
|
647 Properties properties = new Properties(); |
b5e55f460f0b
Closed small file descriptor leak in loading SQL properties file.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
171
diff
changeset
|
648 properties.load(inputStream); |
b5e55f460f0b
Closed small file descriptor leak in loading SQL properties file.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
171
diff
changeset
|
649 return properties; |
b5e55f460f0b
Closed small file descriptor leak in loading SQL properties file.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
171
diff
changeset
|
650 } |
b5e55f460f0b
Closed small file descriptor leak in loading SQL properties file.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
171
diff
changeset
|
651 finally { |
b5e55f460f0b
Closed small file descriptor leak in loading SQL properties file.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
171
diff
changeset
|
652 if (inputStream != null) { |
b5e55f460f0b
Closed small file descriptor leak in loading SQL properties file.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
171
diff
changeset
|
653 try { inputStream.close(); } |
b5e55f460f0b
Closed small file descriptor leak in loading SQL properties file.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
171
diff
changeset
|
654 catch (IOException ioe) {} |
b5e55f460f0b
Closed small file descriptor leak in loading SQL properties file.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
171
diff
changeset
|
655 } |
b5e55f460f0b
Closed small file descriptor leak in loading SQL properties file.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
171
diff
changeset
|
656 } |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
657 } |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
658 } |