Mercurial > dive4elements > river
comparison backend/src/main/java/org/dive4elements/river/importer/ImportRiver.java @ 8559:6d8d7425a6b5
Bed heights are just bed heights since a while ('single' is obsolete).
author | "Tom Gottfried <tom@intevation.de>" |
---|---|
date | Mon, 16 Feb 2015 11:08:33 +0100 |
parents | 29ab66ce06aa |
children | c851d1ea543a |
comparison
equal
deleted
inserted
replaced
8558:d0ea092a32f5 | 8559:6d8d7425a6b5 |
---|---|
162 protected List<ImportWst> waterlevels; | 162 protected List<ImportWst> waterlevels; |
163 | 163 |
164 /** Wst-structures from waterlevel-difference-csv files. */ | 164 /** Wst-structures from waterlevel-difference-csv files. */ |
165 protected List<ImportWst> waterlevelDifferences; | 165 protected List<ImportWst> waterlevelDifferences; |
166 | 166 |
167 protected List<ImportBedHeightSingle> bedHeightSingles; | 167 protected List<ImportBedHeight> bedHeights; |
168 | 168 |
169 protected List<ImportSedimentDensity> sedimentDensities; | 169 protected List<ImportSedimentDensity> sedimentDensities; |
170 | 170 |
171 protected List<ImportPorosity> porosities; | 171 protected List<ImportPorosity> porosities; |
172 | 172 |
454 public void parseBedHeight() throws IOException { | 454 public void parseBedHeight() throws IOException { |
455 File minfoDir = getMinfoDir(); | 455 File minfoDir = getMinfoDir(); |
456 File bedHeightDir = new File(minfoDir, BED_HEIGHT_DIR); | 456 File bedHeightDir = new File(minfoDir, BED_HEIGHT_DIR); |
457 File singlesDir = new File(bedHeightDir, BED_HEIGHT_SINGLE_DIR); | 457 File singlesDir = new File(bedHeightDir, BED_HEIGHT_SINGLE_DIR); |
458 | 458 |
459 if (Config.INSTANCE.skipBedHeightSingle()) { | 459 if (Config.INSTANCE.skipBedHeight()) { |
460 log.info("skip parsing bed height single."); | 460 log.info("skip parsing bed height single."); |
461 } | 461 } |
462 else { | 462 else { |
463 log.info("Parse bed height single."); | 463 log.info("Parse bed height single."); |
464 parseBedHeightSingles(singlesDir); | 464 parseBedHeights(singlesDir); |
465 } | 465 } |
466 } | 466 } |
467 | 467 |
468 | 468 |
469 protected void parseSedimentDensity() throws IOException { | 469 protected void parseSedimentDensity() throws IOException { |
814 | 814 |
815 log.debug("Parsed " + sqRelations.size() + " SQ relations."); | 815 log.debug("Parsed " + sqRelations.size() + " SQ relations."); |
816 } | 816 } |
817 | 817 |
818 | 818 |
819 protected void parseBedHeightSingles(File dir) throws IOException { | 819 protected void parseBedHeights(File dir) throws IOException { |
820 log.debug("Parse bed height singles"); | 820 log.debug("Parse bed height singles"); |
821 | 821 |
822 File[] files = dir.listFiles(); | 822 File[] files = dir.listFiles(); |
823 | 823 |
824 if (files == null) { | 824 if (files == null) { |
830 | 830 |
831 for (File file: files) { | 831 for (File file: files) { |
832 parser.parse(file); | 832 parser.parse(file); |
833 } | 833 } |
834 | 834 |
835 bedHeightSingles = parser.getBedHeights(); | 835 bedHeights = parser.getBedHeights(); |
836 } | 836 } |
837 | 837 |
838 public void parseFloodWater() throws IOException { | 838 public void parseFloodWater() throws IOException { |
839 if (Config.INSTANCE.skipFloodWater()) { | 839 if (Config.INSTANCE.skipFloodWater()) { |
840 log.info("skip parsing flod water"); | 840 log.info("skip parsing flod water"); |
1438 } | 1438 } |
1439 } | 1439 } |
1440 | 1440 |
1441 | 1441 |
1442 public void storeBedHeight() { | 1442 public void storeBedHeight() { |
1443 if (!Config.INSTANCE.skipBedHeightSingle()) { | 1443 if (!Config.INSTANCE.skipBedHeight()) { |
1444 log.info("store bed heights single"); | 1444 log.info("store bed heights"); |
1445 storeBedHeightSingle(); | 1445 River river = getPeer(); |
1446 } | 1446 |
1447 } | 1447 if (bedHeights != null) { |
1448 | 1448 for (ImportBedHeight tmp: bedHeights) { |
1449 | 1449 ImportBedHeight single = (ImportBedHeight) tmp; |
1450 private void storeBedHeightSingle() { | 1450 |
1451 River river = getPeer(); | 1451 String desc = single.getDescription(); |
1452 | 1452 |
1453 if (bedHeightSingles != null) { | 1453 log.debug("name: " + desc); |
1454 for (ImportBedHeightSingle tmp: bedHeightSingles) { | 1454 |
1455 ImportBedHeightSingle single = (ImportBedHeightSingle) tmp; | 1455 single.storeDependencies(river); |
1456 | 1456 } |
1457 String desc = single.getDescription(); | 1457 } |
1458 | 1458 else { |
1459 log.debug("name: " + desc); | 1459 log.info("No bed heights to store."); |
1460 | 1460 } |
1461 single.storeDependencies(river); | |
1462 } | |
1463 } | |
1464 else { | |
1465 log.info("No single bed heights to store."); | |
1466 } | 1461 } |
1467 } | 1462 } |
1468 | 1463 |
1469 | 1464 |
1470 public void storeSedimentDensity() { | 1465 public void storeSedimentDensity() { |