Mercurial > dive4elements > river
comparison flys-backend/src/main/java/de/intevation/flys/importer/ImportRiver.java @ 5810:dba9e1fa233e
ImportRiver: Trigger w80csv-parsing.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 24 Apr 2013 12:07:03 +0200 |
parents | afcad84755f9 |
children |
comparison
equal
deleted
inserted
replaced
5809:53fcc0d5a03e | 5810:dba9e1fa233e |
---|---|
20 import de.intevation.flys.importer.parsers.PegelGltParser; | 20 import de.intevation.flys.importer.parsers.PegelGltParser; |
21 import de.intevation.flys.importer.parsers.SQRelationParser; | 21 import de.intevation.flys.importer.parsers.SQRelationParser; |
22 import de.intevation.flys.importer.parsers.SedimentDensityParser; | 22 import de.intevation.flys.importer.parsers.SedimentDensityParser; |
23 import de.intevation.flys.importer.parsers.SedimentYieldParser; | 23 import de.intevation.flys.importer.parsers.SedimentYieldParser; |
24 import de.intevation.flys.importer.parsers.W80Parser; | 24 import de.intevation.flys.importer.parsers.W80Parser; |
25 import de.intevation.flys.importer.parsers.W80CSVParser; | |
25 import de.intevation.flys.importer.parsers.WaterlevelDifferencesParser; | 26 import de.intevation.flys.importer.parsers.WaterlevelDifferencesParser; |
26 import de.intevation.flys.importer.parsers.WaterlevelParser; | 27 import de.intevation.flys.importer.parsers.WaterlevelParser; |
27 import de.intevation.flys.importer.parsers.WstParser; | 28 import de.intevation.flys.importer.parsers.WstParser; |
28 | 29 |
29 import de.intevation.flys.model.River; | 30 import de.intevation.flys.model.River; |
286 parseAnnotations(); | 287 parseAnnotations(); |
287 parsePRFs(); | 288 parsePRFs(); |
288 parseDA66s(); | 289 parseDA66s(); |
289 parseDA50s(); | 290 parseDA50s(); |
290 parseW80s(); | 291 parseW80s(); |
292 parseW80CSVs(); | |
291 parseHYKs(); | 293 parseHYKs(); |
292 parseWst(); | 294 parseWst(); |
293 parseExtraWsts(); | 295 parseExtraWsts(); |
294 parseFixations(); | 296 parseFixations(); |
295 parseOfficialLines(); | 297 parseOfficialLines(); |
1001 .getParentFile(); // <river> | 1003 .getParentFile(); // <river> |
1002 | 1004 |
1003 ImportRiverCrossSectionParserCallback w80Callback = | 1005 ImportRiverCrossSectionParserCallback w80Callback = |
1004 new ImportRiverCrossSectionParserCallback("w80"); | 1006 new ImportRiverCrossSectionParserCallback("w80"); |
1005 parser.parseW80s(riverDir, w80Callback); | 1007 parser.parseW80s(riverDir, w80Callback); |
1008 } | |
1009 | |
1010 /** Create a W80 Parser and parse w80 files found. */ | |
1011 public void parseW80CSVs() { | |
1012 if (Config.INSTANCE.skipW80CSVs()) { | |
1013 log.info("skip parsing W80 csvs"); | |
1014 return; | |
1015 } | |
1016 W80CSVParser parser = new W80CSVParser(); | |
1017 File riverDir = wstFile | |
1018 .getParentFile() // Basisdaten | |
1019 .getParentFile() // Hydrologie | |
1020 .getParentFile(); // <river> | |
1021 | |
1022 // Construct the Cross-Section-Data path. | |
1023 File csDir = new File(riverDir.getPath() | |
1024 + File.separator + "Geodaesie" | |
1025 + File.separator + "Querprofile" | |
1026 + File.separator + "QP-Daten"); | |
1027 | |
1028 ImportRiverCrossSectionParserCallback w80CSVCallback = | |
1029 new ImportRiverCrossSectionParserCallback("w80-csv"); | |
1030 parser.parseW80CSVs(csDir, w80CSVCallback); | |
1006 } | 1031 } |
1007 | 1032 |
1008 | 1033 |
1009 /** | 1034 /** |
1010 * Create and use a DA50Parser, parse the files found, add the | 1035 * Create and use a DA50Parser, parse the files found, add the |
1116 } | 1141 } |
1117 } | 1142 } |
1118 } | 1143 } |
1119 | 1144 |
1120 public void storeCrossSections() { | 1145 public void storeCrossSections() { |
1121 if (!Config.INSTANCE.skipPRFs() || !Config.INSTANCE.skipDA66s() || !Config.INSTANCE.skipDA50s() || !Config.INSTANCE.skipW80s()) { | 1146 if (!Config.INSTANCE.skipPRFs() |
1147 || !Config.INSTANCE.skipDA66s() | |
1148 || !Config.INSTANCE.skipDA50s() | |
1149 || !Config.INSTANCE.skipW80s() | |
1150 || !Config.INSTANCE.skipW80CSVs()) { | |
1122 log.info("store cross sections"); | 1151 log.info("store cross sections"); |
1123 getPeer(); | 1152 getPeer(); |
1124 for (ImportCrossSection crossSection: crossSections) { | 1153 for (ImportCrossSection crossSection: crossSections) { |
1125 crossSection.storeDependencies(); | 1154 crossSection.storeDependencies(); |
1126 } | 1155 } |