comparison backend/src/main/java/org/dive4elements/river/importer/parsers/BedHeightSingleParser.java @ 7355:d12478cc5bb0

Remove code that was previously commented out.
author Tom Gottfried <tom@intevation.de>
date Wed, 16 Oct 2013 14:43:27 +0200
parents 809e76b7fe38
children 495cde925702
comparison
equal deleted inserted replaced
7354:809e76b7fe38 7355:d12478cc5bb0
61 kmExists.add(key); 61 kmExists.add(key);
62 } 62 }
63 63
64 catch (ParseException e) { 64 catch (ParseException e) {
65 // We expect a lot of ";;;;;;" lines. 65 // We expect a lot of ";;;;;;" lines.
66 //log.warn("BSP: Error while parsing km of data row.", e);
67 return; 66 return;
68 } 67 }
69 68
70 // Handle gaps like "10,0;;;;;". 69 // Handle gaps like "10,0;;;;;".
71 if (values.length == 1) { 70 if (values.length == 1) {
72 // Do not import line without useful data 71 // Do not import line without useful data
73 return; 72 return;
74 } 73 }
75
76 // Because we cannot enforce consistency of values with complete data
77 // via null constraints in the database (as there are "gap" values),
78 // do this checks manually.
79 // if (values[3].length() == 0 || values[4].length() == 0
80 // || values[5].length() == 0) {
81 //log.warn("BSP: Error while parsing data row (manual null constraint violated).");
82 // return;
83 //}
84 74
85 Double height = null; 75 Double height = null;
86 if (values[1].length() > 0) { 76 if (values[1].length() > 0) {
87 try { 77 try {
88 height = new Double(nf.parse(values[1]).doubleValue()); 78 height = new Double(nf.parse(values[1]).doubleValue());
130 catch (ParseException e) { 120 catch (ParseException e) {
131 log.warn("BSP: unparseable width " + values[5]); 121 log.warn("BSP: unparseable width " + values[5]);
132 } 122 }
133 } 123 }
134 124
135 // try {
136 ImportBedHeightSingleValue value = new ImportBedHeightSingleValue( 125 ImportBedHeightSingleValue value = new ImportBedHeightSingleValue(
137 (ImportBedHeightSingle) obj, 126 (ImportBedHeightSingle) obj,
138 km, 127 km,
139 height,//new Double(nf.parse(values[1]).doubleValue()), 128 height,
140 uncertainty, 129 uncertainty,
141 dataGap, 130 dataGap,
142 soundingWidth, 131 soundingWidth,
143 // parseBigDecimal(values[4], line),
144 width 132 width
145 ); 133 );
146 134
147 obj.addValue(value); 135 obj.addValue(value);
148 // }
149 // catch (ParseException e) {
150 // log.warn("BSP: unparseable value in data row.", e);
151 //}
152 } 136 }
153
154 // private BigDecimal parseBigDecimal(String value, String line) {
155 // BigDecimal result = null;
156 // try {
157 // Double dValue = Double.valueOf(value.replace(",", "."));
158 // result = new BigDecimal(dValue.doubleValue());
159 // }
160 // catch (NumberFormatException nfe) {
161 // log.warn(
162 // "Could not parse " +
163 // value +
164 // " in bed heigt single row: "
165 // + line);
166 // }
167 // return result;
168 // }
169 } 137 }
170 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 138 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org