comparison flys-backend/src/main/java/de/intevation/flys/importer/parsers/BedHeightSingleParser.java @ 2809:f283212966e8

Finished work on MINFO bed heights (single). flys-backend/trunk@4221 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 12 Apr 2012 10:42:46 +0000
parents b57c95094b68
children 8926571e47fb
comparison
equal deleted inserted replaced
2808:b57c95094b68 2809:f283212966e8
26 import de.intevation.flys.importer.ImportBedHeightType; 26 import de.intevation.flys.importer.ImportBedHeightType;
27 import de.intevation.flys.importer.ImportElevationModel; 27 import de.intevation.flys.importer.ImportElevationModel;
28 import de.intevation.flys.importer.ImportLocationSystem; 28 import de.intevation.flys.importer.ImportLocationSystem;
29 import de.intevation.flys.importer.ImportRange; 29 import de.intevation.flys.importer.ImportRange;
30 import de.intevation.flys.importer.ImportUnit; 30 import de.intevation.flys.importer.ImportUnit;
31 import de.intevation.flys.model.BedHeightType;
31 32
32 33
33 public class BedHeightSingleParser { 34 public class BedHeightSingleParser {
34 35
35 public static final String ENCODING = "ISO-8859-1"; 36 public static final String ENCODING = "ISO-8859-1";
109 } 110 }
110 else { 111 else {
111 handleDataLine(obj, line); 112 handleDataLine(obj, line);
112 } 113 }
113 } 114 }
115
116 log.info("File contained " + obj.getValues().size() + " values.");
117 bedHeights.add(obj);
114 } 118 }
115 finally { 119 finally {
116 if (in != null) { 120 if (in != null) {
117 in.close(); 121 in.close();
118 } 122 }
257 261
258 if (m.matches()) { 262 if (m.matches()) {
259 String tmp = m.group(1).replace(";", ""); 263 String tmp = m.group(1).replace(";", "");
260 264
261 obj.setType(new ImportBedHeightType( 265 obj.setType(new ImportBedHeightType(
262 ImportBedHeightType.getBedHeightName(tmp), 266 BedHeightType.getBedHeightName(tmp),
263 tmp)); 267 tmp));
264 268
265 return true; 269 return true;
266 } 270 }
267 271
332 return false; 336 return false;
333 } 337 }
334 338
335 339
336 protected void handleDataLine(ImportBedHeightSingle obj, String line) { 340 protected void handleDataLine(ImportBedHeightSingle obj, String line) {
337 log.debug("Handle data line: '" + line + "'");
338
339 String[] values = line.split(SEPERATOR_CHAR); 341 String[] values = line.split(SEPERATOR_CHAR);
340 342
341 if (values == null || values.length < 6) { 343 if (values == null || values.length < 6) {
342 log.warn("Error while parsing data line: '" + line + "'"); 344 //log.warn("Error while parsing data line: '" + line + "'");
343 return; 345 return;
344 } 346 }
345 347
346 348
347 try { 349 try {

http://dive4elements.wald.intevation.org