comparison flys-backend/src/main/java/de/intevation/flys/importer/parsers/SedimentDensityParser.java @ 5508:c6e552348934

SedimentDensityParser: don't try to guess year from comment column
author Tom Gottfried <tom.gottfried@intevation.de>
date Thu, 28 Mar 2013 16:43:20 +0100
parents db6c7268b08e
children a2da78fdbec0
comparison
equal deleted inserted replaced
5507:db6c7268b08e 5508:c6e552348934
148 log.warn("SDP: No km nor density given. Skip line"); 148 log.warn("SDP: No km nor density given. Skip line");
149 return; 149 return;
150 } 150 }
151 151
152 BigDecimal year = null; 152 BigDecimal year = null;
153 try {
154 year =
155 new BigDecimal(nf.parse(vals[vals.length - 1]).doubleValue());
156 }
157 catch(ParseException pe) {
158 try {
159 Date d = DateGuesser.guessDate(vals[vals.length - 1]);
160 Calendar c = Calendar.getInstance();
161 c.setTime(d);
162 year = new BigDecimal(c.get(Calendar.YEAR));
163 }
164 catch (IllegalArgumentException iae) {
165 log.warn("Could not parse date in '" + line + "'");
166 }
167 }
168 153
169 current.addValue(new ImportSedimentDensityValue( 154 current.addValue(new ImportSedimentDensityValue(
170 km, 155 km,
171 shoreOffset, 156 shoreOffset,
172 density, 157 density,

http://dive4elements.wald.intevation.org