Mercurial > dive4elements > gnv-client
annotate gnv-artifacts/src/main/java/de/intevation/gnv/statistics/TimeseriesStatistics.java @ 441:31a12ff53f99
Added raster filter framework for "Profilschnitte"
gnv-artifacts/trunk@489 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Tue, 29 Dec 2009 06:53:31 +0000 |
parents | bed9735adf84 |
children | 04cfb4e3da4f |
rev | line source |
---|---|
93
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
1 /** |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
2 * Title: TimeseriesStatistics, $Header: /share/gdi/SDI-Suite/Repository/projekte/BSH-GDI/genericViewer/src/main/java/de/conterra/bsh/gdi/gnviewer/output/statistics/TimeseriesStatistics.java,v 1.3 2008/08/18 14:50:33 drewnak Exp $ |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
3 * Source: $Source: /share/gdi/SDI-Suite/Repository/projekte/BSH-GDI/genericViewer/src/main/java/de/conterra/bsh/gdi/gnviewer/output/statistics/TimeseriesStatistics.java,v $ |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
4 * created by: Stefan Blume (blume) |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
5 * erstellt am: 06.12.2007 |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
6 * Copyright: con terra GmbH, 2005 |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
7 * |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
8 * modified by: $Author: drewnak $ |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
9 * modified on: $Date: 2008/08/18 14:50:33 $ |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
10 * Version: $Revision: 1.3 $ |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
11 * TAG: $Name: $ |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
12 * locked from: $Locker: $ |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
13 * CVS State: $State: Exp $ |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
14 * Project: $ProjectName$ |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
15 */ |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
16 package de.intevation.gnv.statistics; |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
17 |
98
156db25ad4b4
Add Statisticssupport also to VerticalProfiles
Tim Englich <tim.englich@intevation.de>
parents:
97
diff
changeset
|
18 import java.sql.SQLException; |
93
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
19 import java.util.ArrayList; |
94
6a825a184883
Remove Compile-Errors from the StatisticsPart
Tim Englich <tim.englich@intevation.de>
parents:
93
diff
changeset
|
20 import java.util.Collection; |
6a825a184883
Remove Compile-Errors from the StatisticsPart
Tim Englich <tim.englich@intevation.de>
parents:
93
diff
changeset
|
21 import java.util.Iterator; |
93
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
22 |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
23 import org.apache.commons.math.stat.descriptive.DescriptiveStatistics; |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
24 import org.apache.commons.math.stat.regression.SimpleRegression; |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
25 import org.apache.log4j.Logger; |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
26 |
94
6a825a184883
Remove Compile-Errors from the StatisticsPart
Tim Englich <tim.englich@intevation.de>
parents:
93
diff
changeset
|
27 import de.intevation.gnv.geobackend.base.Result; |
428
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
28 import de.intevation.gnv.geobackend.base.ResultDescriptor; |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
255
diff
changeset
|
29 import de.intevation.gnv.state.describedata.KeyValueDescibeData; |
94
6a825a184883
Remove Compile-Errors from the StatisticsPart
Tim Englich <tim.englich@intevation.de>
parents:
93
diff
changeset
|
30 import de.intevation.gnv.statistics.exception.StatisticsException; |
93
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
31 |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
32 /** |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
33 * The class <code>TimeseriesStatistics</code> fulfills the following purposes: |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
34 * <ol> |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
35 * <li></li> |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
36 * </ol> |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
37 * |
93
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
38 * @author blume |
94
6a825a184883
Remove Compile-Errors from the StatisticsPart
Tim Englich <tim.englich@intevation.de>
parents:
93
diff
changeset
|
39 * @author Tim Englich <tim.englich@intevation.de> |
93
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
40 * @version 1.0 |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
41 * @serial 1.0 |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
42 * @see |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
43 * @since 06.12.2007 18:02:27 |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
44 */ |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
45 public class TimeseriesStatistics implements Statistics { |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
46 |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
47 /** |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
48 * Default Logging instance |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
49 */ |
95
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
94
diff
changeset
|
50 private static Logger log = Logger.getLogger(TimeseriesStatistics.class); |
93
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
51 |
255
5403452c06fc
Added proper values for calculating the Statistics of VerticalProfiles and HorizontalProfiles issue86
Tim Englich <tim.englich@intevation.de>
parents:
253
diff
changeset
|
52 /** |
5403452c06fc
Added proper values for calculating the Statistics of VerticalProfiles and HorizontalProfiles issue86
Tim Englich <tim.englich@intevation.de>
parents:
253
diff
changeset
|
53 * Constructor |
5403452c06fc
Added proper values for calculating the Statistics of VerticalProfiles and HorizontalProfiles issue86
Tim Englich <tim.englich@intevation.de>
parents:
253
diff
changeset
|
54 */ |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
55 public TimeseriesStatistics() { |
95
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
94
diff
changeset
|
56 super(); |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
94
diff
changeset
|
57 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
58 |
98
156db25ad4b4
Add Statisticssupport also to VerticalProfiles
Tim Englich <tim.englich@intevation.de>
parents:
97
diff
changeset
|
59 /** |
253
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
60 * @see de.intevation.gnv.statistics.Statistics#calculateStatistics(java.util.Collection, java.util.Collection, java.util.Collection, java.util.Collection) |
98
156db25ad4b4
Add Statisticssupport also to VerticalProfiles
Tim Englich <tim.englich@intevation.de>
parents:
97
diff
changeset
|
61 */ |
253
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
62 public Collection<StatisticSet> calculateStatistics( |
429
bed9735adf84
Finished preprocessing data for interpolation in verticalcrosssection charts.ß
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
428
diff
changeset
|
63 Collection<Result> resultSet, |
bed9735adf84
Finished preprocessing data for interpolation in verticalcrosssection charts.ß
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
428
diff
changeset
|
64 Collection<KeyValueDescibeData> parameters, |
bed9735adf84
Finished preprocessing data for interpolation in verticalcrosssection charts.ß
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
428
diff
changeset
|
65 Collection<KeyValueDescibeData> measurements, |
bed9735adf84
Finished preprocessing data for interpolation in verticalcrosssection charts.ß
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
428
diff
changeset
|
66 Collection<KeyValueDescibeData> dates |
bed9735adf84
Finished preprocessing data for interpolation in verticalcrosssection charts.ß
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
428
diff
changeset
|
67 ) |
bed9735adf84
Finished preprocessing data for interpolation in verticalcrosssection charts.ß
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
428
diff
changeset
|
68 throws StatisticsException { |
bed9735adf84
Finished preprocessing data for interpolation in verticalcrosssection charts.ß
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
428
diff
changeset
|
69 |
bed9735adf84
Finished preprocessing data for interpolation in verticalcrosssection charts.ß
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
428
diff
changeset
|
70 clearStatistics(); |
93
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
71 DescriptiveStatistics lStatistics = null; |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
72 SimpleRegression lRegression = null; |
253
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
73 Collection<StatisticSet> statisticSets = new ArrayList<StatisticSet>(); |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
74 String break1, break2, break3; |
94
6a825a184883
Remove Compile-Errors from the StatisticsPart
Tim Englich <tim.englich@intevation.de>
parents:
93
diff
changeset
|
75 int lSeries = 1; |
428
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
76 |
429
bed9735adf84
Finished preprocessing data for interpolation in verticalcrosssection charts.ß
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
428
diff
changeset
|
77 if (resultSet == null) { |
bed9735adf84
Finished preprocessing data for interpolation in verticalcrosssection charts.ß
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
428
diff
changeset
|
78 return statisticSets; |
bed9735adf84
Finished preprocessing data for interpolation in verticalcrosssection charts.ß
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
428
diff
changeset
|
79 } |
bed9735adf84
Finished preprocessing data for interpolation in verticalcrosssection charts.ß
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
428
diff
changeset
|
80 |
428
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
81 int b1Idx = -1; |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
82 int b2Idx = -1; |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
83 int b3Idx = -1; |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
84 int yIdx = -1; |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
85 try { |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
86 |
94
6a825a184883
Remove Compile-Errors from the StatisticsPart
Tim Englich <tim.englich@intevation.de>
parents:
93
diff
changeset
|
87 Iterator<Result> resultIterator = resultSet.iterator(); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
88 if (resultIterator.hasNext()) { |
94
6a825a184883
Remove Compile-Errors from the StatisticsPart
Tim Englich <tim.englich@intevation.de>
parents:
93
diff
changeset
|
89 Result row = resultIterator.next(); |
255
5403452c06fc
Added proper values for calculating the Statistics of VerticalProfiles and HorizontalProfiles issue86
Tim Englich <tim.englich@intevation.de>
parents:
253
diff
changeset
|
90 Result previousRow = row; |
428
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
91 |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
92 if (b1Idx == -1) { |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
93 ResultDescriptor rd = row.getResultDescriptor(); |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
94 b1Idx = rd.getColumnIndex("GROUP1"); |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
95 b2Idx = rd.getColumnIndex("GROUP2"); |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
96 b3Idx = rd.getColumnIndex("GROUP3"); |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
97 yIdx = rd.getColumnIndex("YORDINATE"); |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
98 |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
99 if (b1Idx == -1 || b2Idx == -1 || b3Idx == -1 || yIdx == -1) { |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
100 return statisticSets; |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
101 } |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
102 } |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
103 break1 = row.getString(b1Idx); |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
104 break2 = row.getString(b2Idx); |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
105 break3 = row.getString(b3Idx); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
106 lRegression = new SimpleRegression(); |
354
0970d9a7d65e
Upgraded to Apache Commons Math 2.0.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
335
diff
changeset
|
107 lStatistics = new DescriptiveStatistics(); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
108 while (resultIterator.hasNext()) { |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
109 |
428
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
110 if (!break1.equals(row.getString(b1Idx)) |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
111 || !break2.equals(row.getString(b2Idx)) |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
112 || !break3.equals(row.getString(b3Idx)) |
253
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
113 ) { |
428
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
114 String statisticsName = generateStatisticsName( |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
115 break1, break2, |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
116 break3, parameters, |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
117 measurements, dates); |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
118 |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
119 statisticSets.add( |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
120 generateStatisticsValues( |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
121 lStatistics, |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
122 lRegression, |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
123 statisticsName)); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
124 |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
125 lStatistics.clear(); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
126 lRegression.clear(); |
255
5403452c06fc
Added proper values for calculating the Statistics of VerticalProfiles and HorizontalProfiles issue86
Tim Englich <tim.englich@intevation.de>
parents:
253
diff
changeset
|
127 |
428
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
128 clearStatistics(); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
129 |
428
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
130 Double yValue = row.getDouble(yIdx); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
131 |
428
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
132 if (yValue != null) { |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
133 lStatistics.addValue(yValue); |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
134 Double x = calculateXOrdinateValue(previousRow,row); |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
135 lRegression.addData(x, yValue); |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
136 } |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
137 |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
138 break1 = row.getString(b1Idx); |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
139 break2 = row.getString(b2Idx); |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
140 break3 = row.getString(b3Idx); |
255
5403452c06fc
Added proper values for calculating the Statistics of VerticalProfiles and HorizontalProfiles issue86
Tim Englich <tim.englich@intevation.de>
parents:
253
diff
changeset
|
141 previousRow = row; |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
142 row = resultIterator.next(); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
143 lSeries++; |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
144 } else { |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
145 |
428
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
146 Double value = row.getDouble(yIdx); |
416
04a242c67fe6
Added support of gap detection in horizontalcrossprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
359
diff
changeset
|
147 if (value != null) { |
04a242c67fe6
Added support of gap detection in horizontalcrossprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
359
diff
changeset
|
148 lStatistics.addValue(value.doubleValue()); |
04a242c67fe6
Added support of gap detection in horizontalcrossprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
359
diff
changeset
|
149 Double x = calculateXOrdinateValue(previousRow,row); |
04a242c67fe6
Added support of gap detection in horizontalcrossprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
359
diff
changeset
|
150 lRegression.addData(x, value.doubleValue()); |
04a242c67fe6
Added support of gap detection in horizontalcrossprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
359
diff
changeset
|
151 } |
255
5403452c06fc
Added proper values for calculating the Statistics of VerticalProfiles and HorizontalProfiles issue86
Tim Englich <tim.englich@intevation.de>
parents:
253
diff
changeset
|
152 previousRow = row; |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
153 row = resultIterator.next(); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
154 } |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
155 |
94
6a825a184883
Remove Compile-Errors from the StatisticsPart
Tim Englich <tim.englich@intevation.de>
parents:
93
diff
changeset
|
156 } |
428
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
157 |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
158 Double yValue = row.getDouble(yIdx); |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
159 |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
160 if (yValue != null) { |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
161 lStatistics.addValue(yValue); |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
162 Double x = calculateXOrdinateValue(previousRow, row); |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
163 lRegression.addData(x, yValue); |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
164 } |
359
59ad8f37a590
Issue96 Resloved big that one entry is missiing in the Statitic.
Tim Englich <tim.englich@intevation.de>
parents:
354
diff
changeset
|
165 |
428
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
166 String statisticsName = generateStatisticsName( |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
167 break1, break2, |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
168 break3, parameters, |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
169 measurements, dates); |
253
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
170 |
428
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
171 statisticSets.add(generateStatisticsValues( |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
172 lStatistics, |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
173 lRegression, |
88cd37c3b5e4
Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
174 statisticsName)); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
175 lStatistics.clear(); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
176 lRegression.clear(); |
94
6a825a184883
Remove Compile-Errors from the StatisticsPart
Tim Englich <tim.englich@intevation.de>
parents:
93
diff
changeset
|
177 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
178 } catch (Exception e) { |
95
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
94
diff
changeset
|
179 log.error(e.getMessage(), e); |
94
6a825a184883
Remove Compile-Errors from the StatisticsPart
Tim Englich <tim.englich@intevation.de>
parents:
93
diff
changeset
|
180 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
181 |
253
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
182 return statisticSets; |
93
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
183 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
184 |
255
5403452c06fc
Added proper values for calculating the Statistics of VerticalProfiles and HorizontalProfiles issue86
Tim Englich <tim.englich@intevation.de>
parents:
253
diff
changeset
|
185 protected void clearStatistics(){} |
5403452c06fc
Added proper values for calculating the Statistics of VerticalProfiles and HorizontalProfiles issue86
Tim Englich <tim.englich@intevation.de>
parents:
253
diff
changeset
|
186 |
253
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
187 /** |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
188 * |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
189 * @param break1 |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
190 * @param break2 |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
191 * @param break3 |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
192 * @param parameters |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
193 * @param measurements |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
194 * @param dates |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
195 * @return |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
196 */ |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
197 protected String generateStatisticsName(String break1, |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
198 String break2, |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
199 String break3, |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
200 Collection<KeyValueDescibeData> parameters, |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
201 Collection<KeyValueDescibeData> measurements, |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
202 Collection<KeyValueDescibeData> dates){ |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
203 log.debug("TimeseriesStatistics.generateStatisticsName"); |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
204 return this.findValueTitle(parameters,break1)+ " "+ |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
205 this.findValueTitle(measurements,break2) + "m"; |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
206 } |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
207 |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
208 |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
209 protected String findValueTitle(Collection<KeyValueDescibeData> values, |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
210 String id) { |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
211 log.debug("TimeseriesStatistics.findValueTitle "+ id); |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
212 if (values != null) { |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
213 Iterator<KeyValueDescibeData> it = values.iterator(); |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
214 while (it.hasNext()) { |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
215 KeyValueDescibeData data = it.next(); |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
216 if (id.equals(data.getKey())) { |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
217 return data.getValue(); |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
218 } |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
219 } |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
220 } |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
221 return ""; |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
222 } |
255
5403452c06fc
Added proper values for calculating the Statistics of VerticalProfiles and HorizontalProfiles issue86
Tim Englich <tim.englich@intevation.de>
parents:
253
diff
changeset
|
223 protected double calculateXOrdinateValue(Result previousRow, Result row) throws SQLException { |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
224 return new Double((row.getDate("XORDINATE")).getTime() / 1000 / 3600); |
98
156db25ad4b4
Add Statisticssupport also to VerticalProfiles
Tim Englich <tim.englich@intevation.de>
parents:
97
diff
changeset
|
225 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
226 |
94
6a825a184883
Remove Compile-Errors from the StatisticsPart
Tim Englich <tim.englich@intevation.de>
parents:
93
diff
changeset
|
227 /** |
6a825a184883
Remove Compile-Errors from the StatisticsPart
Tim Englich <tim.englich@intevation.de>
parents:
93
diff
changeset
|
228 * @param lStatistics |
6a825a184883
Remove Compile-Errors from the StatisticsPart
Tim Englich <tim.englich@intevation.de>
parents:
93
diff
changeset
|
229 * @param lRegression |
6a825a184883
Remove Compile-Errors from the StatisticsPart
Tim Englich <tim.englich@intevation.de>
parents:
93
diff
changeset
|
230 * @param lStats |
6a825a184883
Remove Compile-Errors from the StatisticsPart
Tim Englich <tim.englich@intevation.de>
parents:
93
diff
changeset
|
231 * @param lSeries |
6a825a184883
Remove Compile-Errors from the StatisticsPart
Tim Englich <tim.englich@intevation.de>
parents:
93
diff
changeset
|
232 */ |
253
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
233 private StatisticSet generateStatisticsValues(DescriptiveStatistics lStatistics, |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
234 SimpleRegression lRegression, String statisticName) { |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
235 |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
236 StatisticSet statisticSet = new StatisticSet(statisticName); |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
237 |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
238 statisticSet.addStatistic(new Statistic( |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
239 "gnviewer.statistics.descriptive.arithmeticMean", lStatistics |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
240 .getMean())); |
253
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
241 statisticSet.addStatistic(new Statistic( |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
242 "gnviewer.statistics.descriptive.kurtosis", lStatistics |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
243 .getKurtosis())); |
253
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
244 statisticSet.addStatistic(new Statistic("gnviewer.statistics.descriptive.max", |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
245 lStatistics.getMax())); |
253
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
246 statisticSet.addStatistic(new Statistic("gnviewer.statistics.descriptive.min", |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
247 lStatistics.getMin())); |
253
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
248 statisticSet.addStatistic(new Statistic("gnviewer.statistics.descriptive.n", |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
249 lStatistics.getN())); |
253
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
250 statisticSet.addStatistic(new Statistic( |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
251 "gnviewer.statistics.descriptive.percentile.90", lStatistics |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
252 .getPercentile(90))); |
253
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
253 statisticSet.addStatistic(new Statistic( |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
254 "gnviewer.statistics.descriptive.percentile.75", lStatistics |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
255 .getPercentile(75))); |
253
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
256 statisticSet.addStatistic(new Statistic( |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
257 "gnviewer.statistics.descriptive.percentile.50", lStatistics |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
258 .getPercentile(50))); |
253
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
259 statisticSet.addStatistic(new Statistic( |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
260 "gnviewer.statistics.descriptive.percentile.10", lStatistics |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
261 .getPercentile(10))); |
253
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
262 statisticSet.addStatistic(new Statistic( |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
263 "gnviewer.statistics.descriptive.deviation", lStatistics |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
264 .getStandardDeviation())); |
253
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
265 statisticSet.addStatistic(new Statistic( |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
266 "gnviewer.statistics.descriptive.variance", lStatistics |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
267 .getVariance())); |
253
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
268 statisticSet.addStatistic(new Statistic( |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
269 "gnviewer.statistics.descriptive.intercept", lRegression |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
270 .getIntercept())); |
253
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
271 statisticSet.addStatistic(new Statistic("gnviewer.statistics.descriptive.slope", |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
272 lRegression.getSlope())); |
253
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
273 return statisticSet; |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
115
diff
changeset
|
274 } |
93
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
275 } |