use of org.n52.io.response.dataset.DatasetParameters in project series-rest-api by 52North.
the class ChartIoHandler method createRangeLabel.
protected String createRangeLabel(DatasetOutput<?> output) {
DatasetParameters parameters = output.getDatasetParameters();
ParameterOutput phenomenon = parameters.getPhenomenon();
StringBuilder uom = new StringBuilder();
uom.append(phenomenon.getLabel());
String uomLabel = output.getUom();
if (uomLabel != null && !uomLabel.isEmpty()) {
uom.append(" [").append(uomLabel).append("]");
}
return uom.toString();
}
use of org.n52.io.response.dataset.DatasetParameters in project series-rest-api by 52North.
the class SimpleCsvIoHandler method getHeader.
@Override
public String[] getHeader(DatasetOutput<T> metadata) {
StringBuilder metaHeader = new StringBuilder();
DatasetParameters datasetParameters = metadata.getDatasetParameters(true);
metaHeader.append(HEADER_PHENOMENON).append(getLabel(datasetParameters.getPhenomenon())).append(LINEBREAK);
metaHeader.append(META_SENSOR).append(getPlatformLabel(metadata)).append(LINEBREAK);
metaHeader.append(META_UNIT).append(metadata.getUom()).append(LINEBREAK);
return isTrajectory(metadata) ? createTrajectoryHeader(metaHeader) : createSimpleHeader(metadata, metaHeader);
}
use of org.n52.io.response.dataset.DatasetParameters in project series-rest-api by 52North.
the class SimpleCsvIoHandler method getFilenameFor.
@Override
protected String getFilenameFor(DatasetOutput<T> metadata) {
DatasetParameters datasetParameters = metadata.getDatasetParameters(true);
String filename = Stream.of(getPlatformLabel(metadata), getLabel(datasetParameters.getPhenomenon()), getLabel(datasetParameters.getProcedure()), metadata.getUom()).collect(Collectors.joining("_"));
return !hasAppropriateLength(filename) ? shortenFileName(filename) : filename;
}
use of org.n52.io.response.dataset.DatasetParameters in project series-rest-api by 52North.
the class ProfileCsvIoHandler method getHeader.
@Override
protected String[] getHeader(DatasetOutput<ProfileValue<?>> metadata) {
StringBuilder metaHeader = new StringBuilder();
DatasetParameters datasetParameters = metadata.getDatasetParameters(true);
metaHeader.append(META_PHENOMENON).append(getLabel(datasetParameters.getPhenomenon())).append(LINEBREAK);
metaHeader.append(META_SENSOR).append(getPlatformLabel(metadata)).append(LINEBREAK);
metaHeader.append(META_UNIT).append(metadata.getUom()).append(LINEBREAK);
return isTrajectory(metadata) ? createTrajectoryHeader(metaHeader) : createSimpleHeader(metadata, metaHeader);
}
use of org.n52.io.response.dataset.DatasetParameters in project series-rest-api by 52North.
the class CsvIoHandler method getPlatformLabel.
protected String getPlatformLabel(DatasetOutput<T> metadata) {
DatasetParameters parameters = metadata.getDatasetParameters(true);
ParameterOutput platform = parameters.getPlatform();
return platform == null ? getLabel(((TimeseriesMetadataOutput) metadata).getStation()) : platform.getLabel();
}
Aggregations