comparison artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDifferenceExporter.java @ 8422:96bf5135cd0e

Bedheight differences exports sounding width and data gap for minuend and subtrahend.
author Raimund Renkert <rrenkert@intevation.de>
date Fri, 17 Oct 2014 13:34:08 +0200
parents 8a14605fb64a
children 322ac5d61777
comparison
equal deleted inserted replaced
8421:0fa963038c61 8422:96bf5135cd0e
65 65
66 private static final String CSV_HEADER_MORPH2 = 66 private static final String CSV_HEADER_MORPH2 =
67 "export.minfo.beddifference.morph2"; 67 "export.minfo.beddifference.morph2";
68 */ 68 */
69 69
70 private static final String CSV_HEADER_SOUNDING1 =
71 "export.minfo.beddifference.sounding1";
72
73 private static final String CSV_HEADER_SOUNDING2 =
74 "export.minfo.beddifference.sounding2";
75
76 private static final String CSV_HEADER_GAP1 =
77 "export.minfo.beddifference.gap1";
78
79 private static final String CSV_HEADER_GAP2 =
80 "export.minfo.beddifference.gap2";
81
70 public static final String JASPER_FILE = 82 public static final String JASPER_FILE =
71 "export.minfo.beddifference.pdf.file"; 83 "export.minfo.beddifference.pdf.file";
72 84
73 public static final String PDF_TITLE= 85 public static final String PDF_TITLE=
74 "export.minfo.beddifference.pdf.title"; 86 "export.minfo.beddifference.pdf.title";
91 for (BedDifferencesResult result : results) { 103 for (BedDifferencesResult result : results) {
92 if (result instanceof BedDiffYearResult) { 104 if (result instanceof BedDiffYearResult) {
93 BedDiffYearResult yResult = (BedDiffYearResult) result; 105 BedDiffYearResult yResult = (BedDiffYearResult) result;
94 String desc = result.getDiffDescription(); 106 String desc = result.getDiffDescription();
95 double[][] kms = yResult.getDifferencesData(); 107 double[][] kms = yResult.getDifferencesData();
108 double[][] sounding1 = yResult.getSoundingWidth1Data();
109 double[][] sounding2 = yResult.getSoundingWidth2Data();
110 double[][] gap1 = yResult.getDataGap1Data();
111 double[][] gap2 = yResult.getDataGap2Data();
96 //double[][] morph1 = yResult.getMorphWidth1Data(); 112 //double[][] morph1 = yResult.getMorphWidth1Data();
97 //double[][] morph2 = yResult.getMorphWidth2Data(); 113 //double[][] morph2 = yResult.getMorphWidth2Data();
98 for (int j = 0; j < kms[0].length; j++) { 114 for (int j = 0; j < kms[0].length; j++) {
99 writer.writeNext(new String[] { 115 writer.writeNext(new String[] {
100 kmf.format(kms[0][j]), 116 kmf.format(kms[0][j]),
101 desc, 117 desc,
102 mf.format(kms[1][j]), 118 mf.format(kms[1][j]),
119 mf.format(sounding1[1][j]),
120 mf.format(sounding2[1][j]),
121 mf.format(gap1[1][j]),
122 mf.format(gap2[1][j])
103 //mf.format(morph1[1][j]), 123 //mf.format(morph1[1][j]),
104 //mf.format(morph2[1][j]), 124 //mf.format(morph2[1][j]),
105 }); 125 });
106 } 126 }
107 } 127 }
182 header.add(msg(CSV_HEADER_DIFF_PAIR, "difference pair")); 202 header.add(msg(CSV_HEADER_DIFF_PAIR, "difference pair"));
183 header.add(msg(CSV_HEADER_DIFF, "cm")); 203 header.add(msg(CSV_HEADER_DIFF, "cm"));
184 /* 204 /*
185 if (results.length > 0 && 205 if (results.length > 0 &&
186 results[0] instanceof BedDiffYearResult) { 206 results[0] instanceof BedDiffYearResult) {
187 header.add(msg(CSV_HEADER_MORPH1, "morph width minuend [m]")); 207 header.add(msg(CSV_HEADER_SOUNDING1, "soundung width minuend [m]"));
188 header.add(msg(CSV_HEADER_MORPH2, "morph width subtrahend [m]")); 208 header.add(msg(CSV_HEADER_SOUNDING2, "sounding width subtrahend [m]"));
209 header.add(msg(CSV_HEADER_GAP1, "data gap minuend"));
210 header.add(msg(CSV_HEADER_GAP2, "data gap subtrahend"));
189 } 211 }
190 */ 212 */
191 } 213 }
192 writer.writeNext(header.toArray(new String[header.size()])); 214 writer.writeNext(header.toArray(new String[header.size()]));
193 } 215 }
200 NumberFormat mf = Formatter.getMeterFormat(context); 222 NumberFormat mf = Formatter.getMeterFormat(context);
201 for (BedDifferencesResult result: results) { 223 for (BedDifferencesResult result: results) {
202 BedDiffYearResult yResult = (BedDiffYearResult) result; 224 BedDiffYearResult yResult = (BedDiffYearResult) result;
203 double[][] kms = result.getDifferencesData(); 225 double[][] kms = result.getDifferencesData();
204 String desc = result.getDiffDescription(); 226 String desc = result.getDiffDescription();
227 double[][] sounding1 = yResult.getSoundingWidth1Data();
228 double[][] sounding2 = yResult.getSoundingWidth2Data();
229 double[][] gap1 = yResult.getDataGap1Data();
230 double[][] gap2 = yResult.getDataGap2Data();
205 //double[][] morph1 = yResult.getMorphWidth1Data(); 231 //double[][] morph1 = yResult.getMorphWidth1Data();
206 //double[][] morph2 = yResult.getMorphWidth2Data(); 232 //double[][] morph2 = yResult.getMorphWidth2Data();
207 for (int j = 0; j < kms[0].length; j++) { 233 for (int j = 0; j < kms[0].length; j++) {
208 source.addData(new String[] { 234 source.addData(new String[] {
209 kmf.format(kms[0][j]), 235 kmf.format(kms[0][j]),
210 desc, 236 desc,
211 mf.format(kms[1][j]), 237 mf.format(kms[1][j]),
238 mf.format(sounding1[1][j]),
239 mf.format(sounding2[1][j]),
240 mf.format(gap1[1][j]),
241 mf.format(gap2[1][j])
212 //mf.format(morph1[1][j]), 242 //mf.format(morph1[1][j]),
213 //mf.format(morph2[1][j]) 243 //mf.format(morph2[1][j])
214 }); 244 });
215 } 245 }
216 } 246 }

http://dive4elements.wald.intevation.org