Mercurial > dive4elements > gnv-client
annotate gnv-artifacts/src/main/java/de/intevation/gnv/transition/profile/horizontalcrosssection/HorizontalCrossSectionMeshOutputTransition.java @ 327:22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
gnv-artifacts/trunk@393 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 02 Dec 2009 10:50:12 +0000 |
parents | e6e172a4915e |
children |
rev | line source |
---|---|
218
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
1 /** |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
2 * |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
3 */ |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
4 package de.intevation.gnv.transition.profile.horizontalcrosssection; |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
5 |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
6 import java.io.IOException; |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
7 import java.io.OutputStream; |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
8 import java.io.OutputStreamWriter; |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
9 import java.io.UnsupportedEncodingException; |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
10 import java.util.Collection; |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
11 import java.util.Iterator; |
300
6a3a02e004d9
Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
256
diff
changeset
|
12 import java.util.Locale; |
218
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
13 |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
14 import org.apache.log4j.Logger; |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
15 |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
16 import au.com.bytecode.opencsv.CSVWriter; |
300
6a3a02e004d9
Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
256
diff
changeset
|
17 import de.intevation.gnv.chart.Chart; |
218
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
18 import de.intevation.gnv.chart.ChartLabels; |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
19 import de.intevation.gnv.geobackend.base.Result; |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
20 import de.intevation.gnv.statistics.Statistics; |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
21 import de.intevation.gnv.transition.exception.TransitionException; |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
22 import de.intevation.gnv.transition.timeseries.TimeSeriesOutputTransition; |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
23 |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
24 /** |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
25 * @author Tim Englich <tim.englich@intevation.de> |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
26 * |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
27 */ |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
28 public class HorizontalCrossSectionMeshOutputTransition |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
29 extends TimeSeriesOutputTransition { |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
30 |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
31 private static Logger log = Logger |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
32 .getLogger(HorizontalCrossSectionMeshOutputTransition.class); |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
33 |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
34 /** |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
35 * The UID of this Class |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
36 */ |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
37 private static final long serialVersionUID = 3233620652465061860L; |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
38 |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
39 /** |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
40 * Constructor |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
41 */ |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
42 public HorizontalCrossSectionMeshOutputTransition() { |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
43 super(); |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
44 super.domainLable = "Latitude [m]"; |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
45 } |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
46 |
307
f0f106c7b906
Fixed some broken Method-Extentions.
Tim Englich <tim.englich@intevation.de>
parents:
301
diff
changeset
|
47 @Override |
300
6a3a02e004d9
Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
256
diff
changeset
|
48 protected Chart getChart( |
6a3a02e004d9
Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
256
diff
changeset
|
49 ChartLabels chartLables, |
6a3a02e004d9
Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
256
diff
changeset
|
50 Collection parameters, |
6a3a02e004d9
Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
256
diff
changeset
|
51 Collection measurements, |
310
45625b5cd6d4
Added timegap definitions to charts. Adapted constructors and constructor calls.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
307
diff
changeset
|
52 Collection dates, |
300
6a3a02e004d9
Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
256
diff
changeset
|
53 Collection result, |
6a3a02e004d9
Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
256
diff
changeset
|
54 Locale locale, |
327
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
324
diff
changeset
|
55 String uuid, |
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
324
diff
changeset
|
56 boolean linesVisible, |
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
324
diff
changeset
|
57 boolean shapesVisible |
300
6a3a02e004d9
Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
256
diff
changeset
|
58 ) { |
6a3a02e004d9
Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
256
diff
changeset
|
59 Chart chart = null; |
6a3a02e004d9
Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
256
diff
changeset
|
60 |
6a3a02e004d9
Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
256
diff
changeset
|
61 if (CACHE_CHART) { |
6a3a02e004d9
Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
256
diff
changeset
|
62 log.info("Try to get horizontalcrosssection chart from cache."); |
6a3a02e004d9
Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
256
diff
changeset
|
63 chart = (Chart) getChartFromCache(uuid); |
6a3a02e004d9
Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
256
diff
changeset
|
64 } |
6a3a02e004d9
Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
256
diff
changeset
|
65 |
6a3a02e004d9
Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
256
diff
changeset
|
66 if (chart != null) |
6a3a02e004d9
Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
256
diff
changeset
|
67 return chart; |
6a3a02e004d9
Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
256
diff
changeset
|
68 |
6a3a02e004d9
Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
256
diff
changeset
|
69 log.info("Chart not in cache yet."); |
6a3a02e004d9
Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
256
diff
changeset
|
70 |
6a3a02e004d9
Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
256
diff
changeset
|
71 log.warn("This sort of chart is not implemented yet."); |
6a3a02e004d9
Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
256
diff
changeset
|
72 /* TODO Implement a special chart for this sort of charts. |
6a3a02e004d9
Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
256
diff
changeset
|
73 chart = new HorizontalProfileChart( |
6a3a02e004d9
Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
256
diff
changeset
|
74 chartLables, |
6a3a02e004d9
Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
256
diff
changeset
|
75 chartTheme, |
6a3a02e004d9
Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
256
diff
changeset
|
76 parameters, |
6a3a02e004d9
Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
256
diff
changeset
|
77 measurements, |
6a3a02e004d9
Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
256
diff
changeset
|
78 result, |
6a3a02e004d9
Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
256
diff
changeset
|
79 dates, |
6a3a02e004d9
Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
256
diff
changeset
|
80 locale |
6a3a02e004d9
Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
256
diff
changeset
|
81 ); |
6a3a02e004d9
Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
256
diff
changeset
|
82 chart.generateChart(); |
6a3a02e004d9
Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
256
diff
changeset
|
83 |
6a3a02e004d9
Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
256
diff
changeset
|
84 if (CACHE_CHART) { |
6a3a02e004d9
Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
256
diff
changeset
|
85 log.info("Put chart into cache."); |
6a3a02e004d9
Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
256
diff
changeset
|
86 purifyChart(chart, uuid); |
6a3a02e004d9
Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
256
diff
changeset
|
87 } |
6a3a02e004d9
Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
256
diff
changeset
|
88 */ |
6a3a02e004d9
Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
256
diff
changeset
|
89 |
6a3a02e004d9
Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
256
diff
changeset
|
90 return chart; |
218
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
91 } |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
92 |
300
6a3a02e004d9
Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
256
diff
changeset
|
93 |
218
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
94 /** |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
95 * @see de.intevation.gnv.transition.timeseries.TimeSeriesOutputTransition#getStatisticsGenerator() |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
96 */ |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
97 @Override |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
98 protected Statistics getStatisticsGenerator() { |
256
008709f79611
Removed Statisticsupport for VerticalCrossSection and HorizontalCrossSection according to Requirement TG_0030.061
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
99 return null; //Statistiken werden nicht f�r diesen Out-Typ unterst�tzt. |
218
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
100 } |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
101 |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
102 /** |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
103 * @see de.intevation.gnv.transition.timeseries.TimeSeriesOutputTransition#createCSV(java.io.OutputStream, |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
104 * java.util.Collection) |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
105 */ |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
106 @Override |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
107 protected void createCSV(OutputStream outputStream, |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
108 Collection<Result> chartResult) |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
109 throws UnsupportedEncodingException, |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
110 IOException, |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
111 TransitionException { |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
112 if (chartResult != null) { |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
113 try { |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
114 CSVWriter writer = new CSVWriter(new OutputStreamWriter( |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
115 outputStream, "ISO-8859-1"), ','); |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
116 // USE THIS ENCODING BECAUSE OF |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
117 // PROBLEMS WITH EXCEL AND UTF-8 |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
118 Iterator<Result> it = chartResult.iterator(); |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
119 while (it.hasNext()) { |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
120 Result result = it.next(); |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
121 int i = 0; |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
122 String[] entries = new String[5]; |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
123 entries[i++] = result.getString("SHAPE"); |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
124 entries[i++] = result.getString("YORDINATE"); |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
125 entries[i++] = result.getString("IPOSITION"); |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
126 entries[i++] = result.getString("JPOSITION"); |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
127 entries[i++] = result.getString("KPOSITION"); |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
128 writer.writeNext(entries); |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
129 } |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
130 writer.close(); |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
131 } catch (Exception e) { |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
132 log.error(e,e); |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
133 throw new TransitionException( |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
134 "Exception occured while parsing an Point from WKT."); |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
135 } |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
136 } else { |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
137 log.error("No Data given for generating an CSV-File."); |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
138 throw new TransitionException( |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
139 "No Data given for generating an CSV-File."); |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
140 } |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
141 } |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
142 |
926530bda1a7
Integrated the OutputTransition for Horizontal Cross-Sections
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
143 } |