use of org.n52.io.type.quantity.generalize.GeneralizingQuantityService in project series-rest-api by 52North.
the class TimeseriesDataController method getTimeseriesData.
private DataCollection<QuantityData> getTimeseriesData(RequestSimpleParameterSet parameters) {
Stopwatch stopwatch = Stopwatch.startStopwatch();
DataCollection<QuantityData> timeseriesData = parameters.isGeneralize() ? new GeneralizingQuantityService(timeseriesDataService).getData(parameters) : timeseriesDataService.getData(parameters);
LOGGER.debug("Processing request took {} seconds.", stopwatch.stopInSeconds());
return timeseriesData;
}
use of org.n52.io.type.quantity.generalize.GeneralizingQuantityService in project series-rest-api by 52North.
the class QuantityIoProcessChain method getData.
@Override
public DataCollection<Data<QuantityValue>> getData() {
boolean generalize = parameters.isGeneralize();
DataService<Data<QuantityValue>> service = generalize ? new GeneralizingQuantityService(dataService) : dataService;
return service.getData(parameters);
}
use of org.n52.io.type.quantity.generalize.GeneralizingQuantityService in project series-rest-api by 52North.
the class QuantityIoFactory method createProcessChain.
@Override
public IoProcessChain<QuantityData> createProcessChain() {
return new IoProcessChain<QuantityData>() {
@Override
public DataCollection<QuantityData> getData() {
final boolean generalize = getParameters().isGeneralize();
DataService<QuantityData> dataService = generalize ? new GeneralizingQuantityService(getDataService()) : getDataService();
return dataService.getData(getRequestParameters());
}
@Override
public DataCollection<?> getProcessedData() {
String format = getParameters().getFormat();
return FormatterFactory.createFormatterFactory(format).create().format(getData());
}
};
}
use of org.n52.io.type.quantity.generalize.GeneralizingQuantityService in project series-rest-api by 52North.
the class TimeseriesDataController method getTimeseriesData.
private DataCollection<Data<QuantityValue>> getTimeseriesData(IoParameters parameters) {
Stopwatch stopwatch = Stopwatch.startStopwatch();
DataCollection<Data<QuantityValue>> timeseriesData = parameters.isGeneralize() ? new GeneralizingQuantityService(timeseriesDataService).getData(parameters) : timeseriesDataService.getData(parameters);
LOGGER.debug("Processing request took {} seconds.", stopwatch.stopInSeconds());
return timeseriesData;
}
Aggregations