use of org.n52.io.response.dataset.TimeseriesMetadataOutput in project series-rest-api by 52North.
the class PDFReportGenerator method addDataTable.
private void addDataTable(TimeSeries timeseries, TimeseriesMetadataOutput metadata, TvpDataCollection<Data<QuantityValue>> dataCollection) {
TableType dataTable = timeseries.addNewTable();
// TODO add language context
dataTable.setLeftColHeader("Date");
dataTable.setRightColHeader(createValueTableHeader(metadata));
Data<QuantityValue> data = dataCollection.getSeries(metadata.getId());
for (QuantityValue valueEntry : data.getValues()) {
Entry entry = dataTable.addNewEntry();
// TODO update TableType schema to allow start/end time
entry.setTime(new DateTime(valueEntry.getTimestamp()).toString());
BigDecimal value = valueEntry.getValue();
entry.setValue(value != null ? value.toString() : null);
}
}
use of org.n52.io.response.dataset.TimeseriesMetadataOutput in project series-rest-api by 52North.
the class PDFReportGenerator method createValueTableHeader.
private String createValueTableHeader(TimeseriesMetadataOutput metadata) {
DatasetParameters parameters = metadata.getDatasetParameters();
String phenomenon = parameters.getPhenomenon().getLabel();
return phenomenon + " (" + metadata.getUom() + ")";
}
Aggregations