changeset 4190:b87d76a6da70

The AT export needs a ld_locations data item The AT export requires a ld_locations data item with the km of the gauge.
author Björn Ricks <bjoern.ricks@intevation.de>
date Fri, 19 Oct 2012 13:32:44 +0200
parents 84ea5f5d84fe
children df959841eefc
files flys-artifacts/src/main/java/de/intevation/flys/artifacts/GaugeDischargeCurveArtifact.java
diffstat 1 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/GaugeDischargeCurveArtifact.java	Fri Oct 19 13:30:05 2012 +0200
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/GaugeDischargeCurveArtifact.java	Fri Oct 19 13:32:44 2012 +0200
@@ -1,5 +1,6 @@
 package de.intevation.flys.artifacts;
 
+import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -89,8 +90,13 @@
 
         Gauge gauge = FLYSUtils.getReferenceGauge(this);
         String gaugename = "";
+        Double gaugelocation = null;
         if (gauge != null) {
             gaugename = gauge.getName();
+            BigDecimal station = gauge.getStation();
+            if (station != null) {
+                gaugelocation = station.doubleValue();
+            }
         }
 
         addData("gauge_name", new DefaultStateData("gauge_name",
@@ -99,6 +105,14 @@
                         "Name of the gauge"),
                     "String", gaugename));
 
+        if (gaugelocation != null) {
+            addData("ld_locations", new DefaultStateData("ld_locations",
+                        Resources.getMsg(callmeta,
+                            "facet.gauge_discharge_curve.gauge_location",
+                            "Location of the gauge"),
+                        "Double", gaugelocation.toString()));
+        }
+
         String description = Resources.format(callmeta,
                 "facet.gauge_discharge_curve.description",
                 "Discharge curve on gauge",

http://dive4elements.wald.intevation.org