comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/GaugeDischargeCurveArtifact.java @ 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 dc4087088c0b
children 8c51c43e59ca
comparison
equal deleted inserted replaced
4189:84ea5f5d84fe 4190:b87d76a6da70
1 package de.intevation.flys.artifacts; 1 package de.intevation.flys.artifacts;
2 2
3 import java.math.BigDecimal;
3 import java.util.ArrayList; 4 import java.util.ArrayList;
4 import java.util.List; 5 import java.util.List;
5 6
6 import org.apache.log4j.Logger; 7 import org.apache.log4j.Logger;
7 8
87 "Gauge official number"), 88 "Gauge official number"),
88 "Long", gaugeref)); 89 "Long", gaugeref));
89 90
90 Gauge gauge = FLYSUtils.getReferenceGauge(this); 91 Gauge gauge = FLYSUtils.getReferenceGauge(this);
91 String gaugename = ""; 92 String gaugename = "";
93 Double gaugelocation = null;
92 if (gauge != null) { 94 if (gauge != null) {
93 gaugename = gauge.getName(); 95 gaugename = gauge.getName();
96 BigDecimal station = gauge.getStation();
97 if (station != null) {
98 gaugelocation = station.doubleValue();
99 }
94 } 100 }
95 101
96 addData("gauge_name", new DefaultStateData("gauge_name", 102 addData("gauge_name", new DefaultStateData("gauge_name",
97 Resources.getMsg(callmeta, 103 Resources.getMsg(callmeta,
98 "facet.gauge_discharge_curve.gauge_name", 104 "facet.gauge_discharge_curve.gauge_name",
99 "Name of the gauge"), 105 "Name of the gauge"),
100 "String", gaugename)); 106 "String", gaugename));
107
108 if (gaugelocation != null) {
109 addData("ld_locations", new DefaultStateData("ld_locations",
110 Resources.getMsg(callmeta,
111 "facet.gauge_discharge_curve.gauge_location",
112 "Location of the gauge"),
113 "Double", gaugelocation.toString()));
114 }
101 115
102 String description = Resources.format(callmeta, 116 String description = Resources.format(callmeta,
103 "facet.gauge_discharge_curve.description", 117 "facet.gauge_discharge_curve.description",
104 "Discharge curve on gauge", 118 "Discharge curve on gauge",
105 rivername, 119 rivername,

http://dive4elements.wald.intevation.org