Mercurial > dive4elements > river
comparison backend/src/main/java/org/dive4elements/river/importer/ImportRiver.java @ 7841:8036688f24e1
Parse and import porosities.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Wed, 30 Apr 2014 14:12:59 +0200 |
parents | 754ed00963d6 |
children | 5813c206ff64 |
comparison
equal
deleted
inserted
replaced
7840:02711de579cc | 7841:8036688f24e1 |
---|---|
25 import org.dive4elements.river.importer.parsers.MeasurementStationsParser; | 25 import org.dive4elements.river.importer.parsers.MeasurementStationsParser; |
26 import org.dive4elements.river.importer.parsers.MorphologicalWidthParser; | 26 import org.dive4elements.river.importer.parsers.MorphologicalWidthParser; |
27 import org.dive4elements.river.importer.parsers.OfficialLinesConfigParser; | 27 import org.dive4elements.river.importer.parsers.OfficialLinesConfigParser; |
28 import org.dive4elements.river.importer.parsers.PRFParser; | 28 import org.dive4elements.river.importer.parsers.PRFParser; |
29 import org.dive4elements.river.importer.parsers.PegelGltParser; | 29 import org.dive4elements.river.importer.parsers.PegelGltParser; |
30 import org.dive4elements.river.importer.parsers.PorosityParser; | |
30 import org.dive4elements.river.importer.parsers.SQRelationParser; | 31 import org.dive4elements.river.importer.parsers.SQRelationParser; |
31 import org.dive4elements.river.importer.parsers.SedimentDensityParser; | 32 import org.dive4elements.river.importer.parsers.SedimentDensityParser; |
32 import org.dive4elements.river.importer.parsers.SedimentYieldParser; | 33 import org.dive4elements.river.importer.parsers.SedimentYieldParser; |
33 import org.dive4elements.river.importer.parsers.W80Parser; | 34 import org.dive4elements.river.importer.parsers.W80Parser; |
34 import org.dive4elements.river.importer.parsers.W80CSVParser; | 35 import org.dive4elements.river.importer.parsers.W80CSVParser; |
94 | 95 |
95 public static final String BED_HEIGHT_EPOCH_DIR = "Epochen"; | 96 public static final String BED_HEIGHT_EPOCH_DIR = "Epochen"; |
96 | 97 |
97 public static final String SEDIMENT_DENSITY_DIR = "Sedimentdichte"; | 98 public static final String SEDIMENT_DENSITY_DIR = "Sedimentdichte"; |
98 | 99 |
100 public static final String POROSITY_DIR = "Porositaet"; | |
101 | |
99 public static final String MORPHOLOGICAL_WIDTH_DIR = "morphologische_Breite"; | 102 public static final String MORPHOLOGICAL_WIDTH_DIR = "morphologische_Breite"; |
100 | 103 |
101 public static final String FLOW_VELOCITY_DIR = "Geschwindigkeit_Schubspannung"; | 104 public static final String FLOW_VELOCITY_DIR = "Geschwindigkeit_Schubspannung"; |
102 | 105 |
103 public static final String FLOW_VELOCITY_MODEL = "Modellrechnungen"; | 106 public static final String FLOW_VELOCITY_MODEL = "Modellrechnungen"; |
161 protected List<ImportBedHeight> bedHeightSingles; | 164 protected List<ImportBedHeight> bedHeightSingles; |
162 | 165 |
163 protected List<ImportBedHeight> bedHeightEpochs; | 166 protected List<ImportBedHeight> bedHeightEpochs; |
164 | 167 |
165 protected List<ImportSedimentDensity> sedimentDensities; | 168 protected List<ImportSedimentDensity> sedimentDensities; |
169 | |
170 protected List<ImportPorosity> porosities; | |
166 | 171 |
167 protected List<ImportMorphWidth> morphologicalWidths; | 172 protected List<ImportMorphWidth> morphologicalWidths; |
168 | 173 |
169 protected List<ImportFlowVelocityModel> flowVelocityModels; | 174 protected List<ImportFlowVelocityModel> flowVelocityModels; |
170 | 175 |
280 floodWater = new ArrayList<ImportWst>(); | 285 floodWater = new ArrayList<ImportWst>(); |
281 waterlevels = new ArrayList<ImportWst>(); | 286 waterlevels = new ArrayList<ImportWst>(); |
282 waterlevelDifferences = new ArrayList<ImportWst>(); | 287 waterlevelDifferences = new ArrayList<ImportWst>(); |
283 floodProtection = new ArrayList<ImportWst>(); | 288 floodProtection = new ArrayList<ImportWst>(); |
284 sedimentDensities = new ArrayList<ImportSedimentDensity>(); | 289 sedimentDensities = new ArrayList<ImportSedimentDensity>(); |
290 porosities = new ArrayList<ImportPorosity>(); | |
285 morphologicalWidths = new ArrayList<ImportMorphWidth>(); | 291 morphologicalWidths = new ArrayList<ImportMorphWidth>(); |
286 flowVelocityModels = new ArrayList<ImportFlowVelocityModel>(); | 292 flowVelocityModels = new ArrayList<ImportFlowVelocityModel>(); |
287 flowVelocityMeasurements = new ArrayList<ImportFlowVelocityMeasurement>(); | 293 flowVelocityMeasurements = new ArrayList<ImportFlowVelocityMeasurement>(); |
288 sedimentYields = new ArrayList<ImportSedimentYield>(); | 294 sedimentYields = new ArrayList<ImportSedimentYield>(); |
289 measurementStations = new ArrayList<ImportMeasurementStation>(); | 295 measurementStations = new ArrayList<ImportMeasurementStation>(); |
373 parseOfficialLines(); | 379 parseOfficialLines(); |
374 parseFloodWater(); | 380 parseFloodWater(); |
375 parseFloodProtection(); | 381 parseFloodProtection(); |
376 parseBedHeight(); | 382 parseBedHeight(); |
377 parseSedimentDensity(); | 383 parseSedimentDensity(); |
384 parsePorosity(); | |
378 parseMorphologicalWidth(); | 385 parseMorphologicalWidth(); |
379 parseFlowVelocity(); | 386 parseFlowVelocity(); |
380 parseSedimentYield(); | 387 parseSedimentYield(); |
381 parseWaterlevels(); | 388 parseWaterlevels(); |
382 parseWaterlevelDifferences(); | 389 parseWaterlevelDifferences(); |
490 sedimentDensities = parser.getSedimentDensities(); | 497 sedimentDensities = parser.getSedimentDensities(); |
491 | 498 |
492 log.info("Parsed " + sedimentDensities.size() + " sediment densities."); | 499 log.info("Parsed " + sedimentDensities.size() + " sediment densities."); |
493 } | 500 } |
494 | 501 |
502 protected void parsePorosity() throws IOException { | |
503 if (Config.INSTANCE.skipPorosity()) { | |
504 log.info("skip parsing porosity."); | |
505 return; | |
506 } | |
507 | |
508 log.debug("Parse porosity"); | |
509 | |
510 File minfoDir = getMinfoDir(); | |
511 File porosity = new File(minfoDir, POROSITY_DIR); | |
512 | |
513 File[] files = porosity.listFiles(); | |
514 | |
515 if (files == null) { | |
516 log.warn("Cannot read directory '" + porosity + "'"); | |
517 return; | |
518 } | |
519 | |
520 PorosityParser parser = new PorosityParser(); | |
521 | |
522 for (File file: files) { | |
523 parser.parse(file); | |
524 } | |
525 | |
526 porosities = parser.getPorosities(); | |
527 | |
528 log.info("Parsed " + porosities.size() + " porosities."); | |
529 } | |
495 | 530 |
496 protected void parseMorphologicalWidth() throws IOException { | 531 protected void parseMorphologicalWidth() throws IOException { |
497 if (Config.INSTANCE.skipMorphologicalWidth()) { | 532 if (Config.INSTANCE.skipMorphologicalWidth()) { |
498 log.info("skip parsing morphological width."); | 533 log.info("skip parsing morphological width."); |
499 return; | 534 return; |
1248 storeOfficialLines(); | 1283 storeOfficialLines(); |
1249 storeFloodWater(); | 1284 storeFloodWater(); |
1250 storeFloodProtection(); | 1285 storeFloodProtection(); |
1251 storeBedHeight(); | 1286 storeBedHeight(); |
1252 storeSedimentDensity(); | 1287 storeSedimentDensity(); |
1288 storePorosity(); | |
1253 storeMorphologicalWidth(); | 1289 storeMorphologicalWidth(); |
1254 storeFlowVelocity(); | 1290 storeFlowVelocity(); |
1255 storeSedimentYield(); | 1291 storeSedimentYield(); |
1256 storeWaterlevels(); | 1292 storeWaterlevels(); |
1257 storeWaterlevelDifferences(); | 1293 storeWaterlevelDifferences(); |
1465 String desc = density.getDescription(); | 1501 String desc = density.getDescription(); |
1466 | 1502 |
1467 log.debug("name: " + desc); | 1503 log.debug("name: " + desc); |
1468 | 1504 |
1469 density.storeDependencies(river); | 1505 density.storeDependencies(river); |
1506 } | |
1507 } | |
1508 } | |
1509 | |
1510 public void storePorosity() { | |
1511 if (!Config.INSTANCE.skipPorosity()) { | |
1512 log.info("store porosity"); | |
1513 | |
1514 River river = getPeer(); | |
1515 | |
1516 for (ImportPorosity porosity: porosities) { | |
1517 String desc = porosity.getDescription(); | |
1518 | |
1519 log.debug("name: " + desc); | |
1520 | |
1521 porosity.storeDependencies(river); | |
1470 } | 1522 } |
1471 } | 1523 } |
1472 } | 1524 } |
1473 | 1525 |
1474 public void storeMorphologicalWidth() { | 1526 public void storeMorphologicalWidth() { |