Mercurial > dive4elements > river
comparison flys-backend/src/main/java/de/intevation/flys/importer/ImportRiver.java @ 2826:c3f8cf0cdf69
Prepared the importer to parse flow velocity files and added a config option to skip that process.
flys-backend/trunk@4243 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 17 Apr 2012 06:51:39 +0000 |
parents | 0a536eb5d668 |
children | 85b25e74594f |
comparison
equal
deleted
inserted
replaced
2825:a948366d8ac5 | 2826:c3f8cf0cdf69 |
---|---|
70 public static final String BED_HEIGHT_EPOCH_DIR = "Epochen"; | 70 public static final String BED_HEIGHT_EPOCH_DIR = "Epochen"; |
71 | 71 |
72 public static final String SEDIMENT_DENSITY_DIR = "Sedimentdichte"; | 72 public static final String SEDIMENT_DENSITY_DIR = "Sedimentdichte"; |
73 | 73 |
74 public static final String MORPHOLOGICAL_WIDTH_DIR = "morphologische_Breite"; | 74 public static final String MORPHOLOGICAL_WIDTH_DIR = "morphologische_Breite"; |
75 | |
76 public static final String FLOW_VELOCITY_DIR = "Geschwindigkeit_Schubspannung"; | |
77 | |
78 public static final String FLOW_VELOCITY_MODEL = "Modellrechnungen"; | |
79 | |
80 public static final String FLOW_VELOCITY_MEASUREMENTS = "v-Messungen"; | |
75 | 81 |
76 | 82 |
77 protected String name; | 83 protected String name; |
78 | 84 |
79 protected File wstFile; | 85 protected File wstFile; |
188 parseFloodWater(); | 194 parseFloodWater(); |
189 parseFloodProtection(); | 195 parseFloodProtection(); |
190 parseBedHeight(); | 196 parseBedHeight(); |
191 parseSedimentDensity(); | 197 parseSedimentDensity(); |
192 parseMorphologicalWidth(); | 198 parseMorphologicalWidth(); |
199 parseFlowVelocity(); | |
193 } | 200 } |
194 | 201 |
195 public void parseFloodProtection() throws IOException { | 202 public void parseFloodProtection() throws IOException { |
196 if (Config.INSTANCE.skipFloodProtection()) { | 203 if (Config.INSTANCE.skipFloodProtection()) { |
197 log.info("skip parsing flood protection"); | 204 log.info("skip parsing flood protection"); |
316 } | 323 } |
317 | 324 |
318 morphologicalWidths = parser.getMorphologicalWidths(); | 325 morphologicalWidths = parser.getMorphologicalWidths(); |
319 | 326 |
320 log.info("Parsed " + morphologicalWidths.size() + " morph. widths files."); | 327 log.info("Parsed " + morphologicalWidths.size() + " morph. widths files."); |
328 } | |
329 | |
330 | |
331 protected void parseFlowVelocity() throws IOException { | |
332 log.debug("Parse flow velocity"); | |
333 | |
334 if (Config.INSTANCE.skipFlowVelocity()) { | |
335 log.info("skip parsing flow velocity"); | |
336 return; | |
337 } | |
338 | |
339 File minfoDir = getMinfoDir(); | |
340 File flowDir = new File(minfoDir, FLOW_VELOCITY_DIR); | |
341 File modelDir = new File(flowDir, FLOW_VELOCITY_MODEL); | |
342 File measureDir = new File(flowDir, FLOW_VELOCITY_MEASUREMENTS); | |
343 | |
344 File[] modelFiles = modelDir.listFiles(); | |
345 File[] measureFiles = measureDir.listFiles(); | |
346 | |
347 if (modelFiles == null) { | |
348 log.warn("Cannot parse directory '" + modelDir + "'"); | |
349 } | |
350 else { | |
351 // TODO | |
352 for (File model: modelFiles) { | |
353 log.debug("Parse file '" + model + "'"); | |
354 } | |
355 } | |
356 | |
357 if (measureFiles == null) { | |
358 log.warn("Cannot parse directory '" + measureDir + "'"); | |
359 } | |
360 else { | |
361 // TODO | |
362 for (File measurement: measureFiles) { | |
363 log.debug("Parse file '" + measurement + "'"); | |
364 } | |
365 } | |
321 } | 366 } |
322 | 367 |
323 | 368 |
324 protected void parseBedHeightSingles(File dir) throws IOException { | 369 protected void parseBedHeightSingles(File dir) throws IOException { |
325 log.debug("Parse bed height singles"); | 370 log.debug("Parse bed height singles"); |
686 storeFloodWater(); | 731 storeFloodWater(); |
687 storeFloodProtection(); | 732 storeFloodProtection(); |
688 storeBedHeight(); | 733 storeBedHeight(); |
689 storeSedimentDensity(); | 734 storeSedimentDensity(); |
690 storeMorphologicalWidth(); | 735 storeMorphologicalWidth(); |
736 storeFlowVelocity(); | |
691 } | 737 } |
692 | 738 |
693 public void storeWstUnit() { | 739 public void storeWstUnit() { |
694 if (wst == null) { | 740 if (wst == null) { |
695 wstUnit = new ImportUnit("NN + m"); | 741 wstUnit = new ImportUnit("NN + m"); |
889 } | 935 } |
890 catch (ConstraintViolationException cve) { | 936 catch (ConstraintViolationException cve) { |
891 log.error("Error while parsing file for morph. width."); | 937 log.error("Error while parsing file for morph. width."); |
892 } | 938 } |
893 } | 939 } |
940 } | |
941 } | |
942 | |
943 public void storeFlowVelocity() { | |
944 if (!Config.INSTANCE.skipFlowVelocity()) { | |
945 log.info("store flow velocity"); | |
946 | |
947 // TODO | |
894 } | 948 } |
895 } | 949 } |
896 | 950 |
897 public void storeAnnotations() { | 951 public void storeAnnotations() { |
898 if (!Config.INSTANCE.skipAnnotations()) { | 952 if (!Config.INSTANCE.skipAnnotations()) { |