Search in sources :

Example 1 with DatasetParameters

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();
}
Also used : DatasetParameters(org.n52.io.response.dataset.DatasetParameters) ParameterOutput(org.n52.io.response.ParameterOutput)

Example 2 with DatasetParameters

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);
}
Also used : DatasetParameters(org.n52.io.response.dataset.DatasetParameters)

Example 3 with DatasetParameters

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;
}
Also used : DatasetParameters(org.n52.io.response.dataset.DatasetParameters)

Example 4 with DatasetParameters

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);
}
Also used : DatasetParameters(org.n52.io.response.dataset.DatasetParameters)

Example 5 with DatasetParameters

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();
}
Also used : TimeseriesMetadataOutput(org.n52.io.response.dataset.TimeseriesMetadataOutput) DatasetParameters(org.n52.io.response.dataset.DatasetParameters) ParameterOutput(org.n52.io.response.ParameterOutput)

Aggregations

DatasetParameters (org.n52.io.response.dataset.DatasetParameters)9 ParameterOutput (org.n52.io.response.ParameterOutput)3 IOException (java.io.IOException)1 Test (org.junit.jupiter.api.Test)1 IoParseException (org.n52.io.IoParseException)1 IoStyleContext (org.n52.io.IoStyleContext)1 IoParameters (org.n52.io.request.IoParameters)1 CategoryOutput (org.n52.io.response.CategoryOutput)1 FeatureOutput (org.n52.io.response.FeatureOutput)1 OfferingOutput (org.n52.io.response.OfferingOutput)1 PhenomenonOutput (org.n52.io.response.PhenomenonOutput)1 PlatformOutput (org.n52.io.response.PlatformOutput)1 ProcedureOutput (org.n52.io.response.ProcedureOutput)1 ServiceOutput (org.n52.io.response.ServiceOutput)1 DatasetOutput (org.n52.io.response.dataset.DatasetOutput)1 TimeseriesMetadataOutput (org.n52.io.response.dataset.TimeseriesMetadataOutput)1 DocumentStructureType (org.n52.oxf.DocumentStructureType)1 TimeSeries (org.n52.oxf.DocumentStructureType.TimeSeries)1