Search in sources :

Example 1 with GetFeaturesSizeRequest

use of org.polymap.core.data.feature.GetFeaturesSizeRequest in project polymap4-core by Polymap4.

the class PipelineFeatureSource method getCountInternal.

@Override
@SuppressWarnings("hiding")
protected int getCountInternal(Query query) throws IOException {
    GetFeaturesSizeRequest request = new GetFeaturesSizeRequest(query);
    try {
        final int[] result = new int[1];
        newExecutor().execute(pipeline, request, (ProcessorResponse r) -> {
            GetFeaturesSizeResponse response = (GetFeaturesSizeResponse) r;
            result[0] = response.getSize();
        });
        return result[0];
    } catch (Exception e) {
        Throwables.propagateIfInstanceOf(e, IOException.class);
        throw Throwables.propagate(e);
    }
}
Also used : GetFeaturesSizeRequest(org.polymap.core.data.feature.GetFeaturesSizeRequest) ProcessorResponse(org.polymap.core.data.pipeline.ProcessorResponse) GetFeaturesSizeResponse(org.polymap.core.data.feature.GetFeaturesSizeResponse) IOException(java.io.IOException) IOException(java.io.IOException)

Example 2 with GetFeaturesSizeRequest

use of org.polymap.core.data.feature.GetFeaturesSizeRequest in project polymap4-core by Polymap4.

the class FeatureRenameProcessor method featuresSizeRequest.

@Produces(GetFeaturesSizeRequest.class)
public void featuresSizeRequest(GetFeaturesSizeRequest request, ProcessorContext context) throws Exception {
    Query transformed = transformQuery(request.getQuery(), context);
    context.sendRequest(new GetFeaturesSizeRequest(transformed));
}
Also used : GetFeaturesSizeRequest(org.polymap.core.data.feature.GetFeaturesSizeRequest) Query(org.geotools.data.Query) Produces(org.polymap.core.data.pipeline.Produces)

Aggregations

GetFeaturesSizeRequest (org.polymap.core.data.feature.GetFeaturesSizeRequest)2 IOException (java.io.IOException)1 Query (org.geotools.data.Query)1 GetFeaturesSizeResponse (org.polymap.core.data.feature.GetFeaturesSizeResponse)1 ProcessorResponse (org.polymap.core.data.pipeline.ProcessorResponse)1 Produces (org.polymap.core.data.pipeline.Produces)1