changeset 4762:c6654a19b00f

W80Parser: Use DateGuesser to set a date.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Fri, 04 Jan 2013 11:12:28 +0100
parents ab87408bb0d3
children 8195396b23ce
files flys-backend/src/main/java/de/intevation/flys/importer/parsers/W80Parser.java
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/flys-backend/src/main/java/de/intevation/flys/importer/parsers/W80Parser.java	Fri Jan 04 11:11:52 2013 +0100
+++ b/flys-backend/src/main/java/de/intevation/flys/importer/parsers/W80Parser.java	Fri Jan 04 11:12:28 2013 +0100
@@ -7,6 +7,8 @@
 import de.intevation.flys.utils.EpsilonComparator;
 import de.intevation.flys.importer.parsers.tim.Coordinate;
 
+import de.intevation.flys.utils.DateGuesser;
+
 import java.io.File;
 import java.io.IOException;
 
@@ -81,7 +83,9 @@
     /** Get the year of this cross sections measurement. */
     @Override
     public Integer getYear() {
-        return null;
+        Calendar dateCalendar = Calendar.getInstance();
+        dateCalendar.setTime(anchorDate);
+        return dateCalendar.get(Calendar.YEAR);
     }
 
 
@@ -221,6 +225,7 @@
             currentLine = new ArrayList<XY>();
             data.put(stationKm, currentLine);
             currentLine.add(new XY(0d, heightM,0));
+            anchorDate = DateGuesser.guessDate(date);
         }
         else {
             addPoint(gkRightKm, gkHighKm, heightM, pointIndex);

http://dive4elements.wald.intevation.org