changeset 4368:1c5370683769

Fixed sediment yield parser. * Fixed loading files ending with '_Sand.csv'. There are different files ending like this, containing different data sets. * Added new file ending. Naming for files is different in single year and official epochs.
author Raimund Renkert <rrenkert@intevation.de>
date Fri, 02 Nov 2012 14:43:01 +0100
parents 8d568bc22765
children 8ddab49ff297
files flys-backend/src/main/java/de/intevation/flys/importer/parsers/SedimentYieldParser.java
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/flys-backend/src/main/java/de/intevation/flys/importer/parsers/SedimentYieldParser.java	Fri Nov 02 14:30:39 2012 +0100
+++ b/flys-backend/src/main/java/de/intevation/flys/importer/parsers/SedimentYieldParser.java	Fri Nov 02 14:43:01 2012 +0100
@@ -45,6 +45,9 @@
         "_susp_Sand.csv";
 
     public static final String FRACTION_SUSP_SAND_BED =
+        "_bettbild_Anteil_susp_Sand.csv";
+
+    public static final String FRACTION_SUSP_SAND_BED_EPOCH =
         "_susp_Sand_bettbildAnteil.csv";
 
     public static final String FRACTION_SUSPENDED_SEDIMENT =
@@ -367,13 +370,16 @@
         else if (filename.endsWith(FRACTION_FINE_MIDDLE_STR)) {
             return GrainFraction.FINE_MIDDLE;
         }
-        else if (filename.endsWith(FRACTION_SAND)) {
+        else if (filename.endsWith(FRACTION_SAND) &&
+            !filename.endsWith(FRACTION_SUSP_SAND)) {
             return GrainFraction.SAND;
         }
-        else if (filename.endsWith(FRACTION_SUSP_SAND)) {
+        else if (filename.endsWith(FRACTION_SUSP_SAND) &&
+            !filename.endsWith(FRACTION_SUSP_SAND_BED)) {
             return GrainFraction.SUSP_SAND;
         }
-        else if (filename.endsWith(FRACTION_SUSP_SAND_BED)) {
+        else if (filename.endsWith(FRACTION_SUSP_SAND_BED) ||
+            filename.endsWith(FRACTION_SUSP_SAND_BED_EPOCH)) {
             return GrainFraction.SUSP_SAND_BED;
         }
         else if (filename.endsWith(FRACTION_SUSPENDED_SEDIMENT)) {

http://dive4elements.wald.intevation.org