changeset 2272:4a8b519b64bd

Extend reference curve export to include km location as string. flys-artifacts/trunk@3929 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Mon, 06 Feb 2012 14:22:26 +0000 (2012-02-06)
parents 3973a2451cf7
children 7b8d59436be3
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/exports/ReferenceCurveExporter.java
diffstat 2 files changed, 24 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Mon Feb 06 14:21:02 2012 +0000
+++ b/flys-artifacts/ChangeLog	Mon Feb 06 14:22:26 2012 +0000
@@ -1,3 +1,9 @@
+2012-02-06  Felix Wolfsteller	<felix.wolfsteller@intevation.de>
+
+	* src/main/java/de/intevation/flys/exports/ReferenceCurveExporter.java:
+	  Include location description string in csv output of referencecurve-
+	  exporter.
+
 2012-02-06	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* src/main/java/de/intevation/flys/artifacts/model/WW.java: Added constructor call.
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/ReferenceCurveExporter.java	Mon Feb 06 14:21:02 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/ReferenceCurveExporter.java	Mon Feb 06 14:22:26 2012 +0000
@@ -26,6 +26,7 @@
 import de.intevation.artifacts.CallMeta;
 import de.intevation.artifacts.common.utils.Config;
 
+import de.intevation.flys.artifacts.FLYSArtifact;
 import de.intevation.flys.artifacts.WINFOArtifact;
 
 import de.intevation.flys.artifacts.model.CalculationResult;
@@ -54,6 +55,11 @@
     public static final String RC_CSV_Q_HEADER =
         "export.reference_curve.csv.header.q";
 
+    public static final String CSV_LOCATION_HEADER =
+        "export.waterlevel.csv.header.location";
+
+    public static final String DEFAULT_CSV_LOCATION_HEADER = "Lage";
+
     /*
         For each Bezugs and Ziel-ort (of which there might be multiples):
           Lage, Bezeichnung, Q, W (cm), W(NN+m).
@@ -152,9 +158,11 @@
 
         writer.writeNext(new String[] {
             msg(RC_CSV_KM_HEADER, RC_DEFAULT_CSV_KM_HEADER),
+            msg(CSV_LOCATION_HEADER, DEFAULT_CSV_LOCATION_HEADER),
             msg(RC_CSV_W_HEADER, RC_DEFAULT_CSV_W_HEADER),
             msg(RC_CSV_Q_HEADER, RC_DEFAULT_CSV_Q_HEADER),
             msg(RC_CSV_KM_HEADER, RC_DEFAULT_CSV_KM_HEADER),
+            msg(CSV_LOCATION_HEADER, DEFAULT_CSV_LOCATION_HEADER),
             msg(RC_CSV_W_HEADER, RC_DEFAULT_CSV_W_HEADER),
             msg(RC_CSV_Q_HEADER, RC_DEFAULT_CSV_Q_HEADER),
         });
@@ -168,14 +176,22 @@
         NumberFormat wf   = getWFormatter();
         int          size = ww.size();
 
+        FLYSArtifact flys       = (FLYSArtifact) master;
+
+        String startLocationDescription = FLYSUtils.getLocationDescription(
+            flys, ww.getStartKm());
+
+        String endLocationDescription = FLYSUtils.getLocationDescription(
+            flys, ww.getEndKm());
+
         for (int i = 0; i < size; i ++) {
-
-            // TODO: start/end ... start/end ..
             writer.writeNext(new String[] {
                 kmf.format(ww.getStartKm()),
+                startLocationDescription,
                 wf.format(ww.getW1(i)),
                 "", // "Q"
                 kmf.format(ww.getEndKm()),
+                endLocationDescription,
                 wf.format(ww.getW2(i)),
                 "" // "Q"
             });

http://dive4elements.wald.intevation.org