Mercurial > dive4elements > river
diff backend/src/main/java/org/dive4elements/river/importer/ImportRiver.java @ 7340:2ce7bacc940f double-precision
Merged changes from default into double precision branch.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Tue, 15 Oct 2013 18:41:55 +0200 |
parents | 7fabae60428b 40e5ad76103c |
children | d93bb557a94f |
line wrap: on
line diff
--- a/backend/src/main/java/org/dive4elements/river/importer/ImportRiver.java Tue Oct 15 15:32:36 2013 +0200 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportRiver.java Tue Oct 15 18:41:55 2013 +0200 @@ -356,12 +356,17 @@ continue; } log.info("found file '" + file.getName() + "'"); - WstParser wstParser = new WstParser(); - wstParser.parse(file); - ImportWst iw = wstParser.getWst(); - iw.setKind(5); - iw.setDescription(FLOOD_PROTECTION + "/" + iw.getDescription()); - floodProtection.add(iw); + try { + WstParser wstParser = new WstParser(); + wstParser.parse(file); + ImportWst iw = wstParser.getWst(); + iw.setKind(5); + iw.setDescription(FLOOD_PROTECTION + "/" + iw.getDescription()); + floodProtection.add(iw); + } + catch (WstParser.ParseException e) { + log.error(e); + } } } @@ -768,12 +773,17 @@ continue; } log.info("found file '" + file.getName() + "'"); - WstParser wstParser = new WstParser(); - wstParser.parse(file); - ImportWst iw = wstParser.getWst(); - iw.setKind(4); - iw.setDescription(FLOOD_WATER + "/" + iw.getDescription()); - floodWater.add(iw); + try { + WstParser wstParser = new WstParser(); + wstParser.parse(file); + ImportWst iw = wstParser.getWst(); + iw.setKind(4); + iw.setDescription(FLOOD_WATER + "/" + iw.getDescription()); + floodWater.add(iw); + } + catch (WstParser.ParseException e) { + log.error(e); + } } } @@ -805,7 +815,14 @@ ImportWst iw = new ImportWst(ImportOfficialWstColumn.COLUMN_FACTORY); WstParser wstParser = new WstParser(iw); - wstParser.parse(file); + try { + wstParser.parse(file); + } + catch (WstParser.ParseException e) { + log.error(e); + continue; + } + iw.setKind(3); iw.setDescription(folder + "/" + iw.getDescription()); @@ -878,12 +895,17 @@ } log.debug("Found WST file: " + file); - WstParser wstParser = new WstParser(); - wstParser.parse(file); - ImportWst iw = wstParser.getWst(); - iw.setKind(2); - iw.setDescription(FIXATIONS+ "/" + iw.getDescription()); - fixations.add(iw); + try { + WstParser wstParser = new WstParser(); + wstParser.parse(file); + ImportWst iw = wstParser.getWst(); + iw.setKind(2); + iw.setDescription(FIXATIONS+ "/" + iw.getDescription()); + fixations.add(iw); + } + catch (WstParser.ParseException e) { + log.error(e); + } } } @@ -922,12 +944,17 @@ } log.debug("Found WST file: " + file); - WstParser wstParser = new WstParser(); - wstParser.parse(file); - ImportWst iw = wstParser.getWst(); - iw.setKind(1); - iw.setDescription(EXTRA_LONGITUDINALS + "/" + iw.getDescription()); - extraWsts.add(iw); + try { + WstParser wstParser = new WstParser(); + wstParser.parse(file); + ImportWst iw = wstParser.getWst(); + iw.setKind(1); + iw.setDescription(EXTRA_LONGITUDINALS + "/" + iw.getDescription()); + extraWsts.add(iw); + } + catch (WstParser.ParseException e) { + log.error(e); + } } } @@ -939,9 +966,14 @@ } WstParser wstParser = new WstParser(); - wstParser.parse(wstFile); - wst = wstParser.getWst(); - wst.setKmUp(wst.guessWaterLevelIncreasing()); + try { + wstParser.parse(wstFile); + wst = wstParser.getWst(); + wst.setKmUp(wst.guessWaterLevelIncreasing()); + } + catch (WstParser.ParseException e) { + log.error(e); + } } public void parseGauges() throws IOException { @@ -1356,8 +1388,7 @@ log.debug("name: " + desc); - single.storeDependencies(river); - + single.storeDependencies(river); } } else { @@ -1377,8 +1408,7 @@ log.debug("name: " + desc); - epoch.storeDependencies(river); - + epoch.storeDependencies(river); } } else { @@ -1397,8 +1427,7 @@ log.debug("name: " + desc); - density.storeDependencies(river); - + density.storeDependencies(river); } } } @@ -1410,9 +1439,7 @@ River river = getPeer(); for (ImportMorphWidth width: morphologicalWidths) { - - width.storeDependencies(river); - + width.storeDependencies(river); } } } @@ -1424,15 +1451,11 @@ River river = getPeer(); for (ImportFlowVelocityModel flowVelocityModel: flowVelocityModels){ - - flowVelocityModel.storeDependencies(river); - + flowVelocityModel.storeDependencies(river); } for (ImportFlowVelocityMeasurement m: flowVelocityMeasurements) { - - m.storeDependencies(river); - + m.storeDependencies(river); } } } @@ -1445,9 +1468,7 @@ River river = getPeer(); for (ImportSedimentYield sedimentYield: sedimentYields) { - - sedimentYield.storeDependencies(river); - + sedimentYield.storeDependencies(river); } } } @@ -1462,12 +1483,10 @@ int count = 0; for (ImportMeasurementStation station: measurementStations) { - - boolean success = station.storeDependencies(river); - if (success) { - count++; - } - + boolean success = station.storeDependencies(river); + if (success) { + count++; + } } log.info("stored " + count + " measurement stations."); @@ -1484,10 +1503,8 @@ int count = 0; for (ImportSQRelation sqRelation: sqRelations) { - - sqRelation.storeDependencies(river); - count++; - + sqRelation.storeDependencies(river); + count++; } log.info("stored " + count + " sq relations.");