Search in sources :

Example 1 with GetFeaturesRequest

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

the class PipelineFeatureSource method fetchFeatures.

/**
 * Called by {@link SyncPipelineFeatureCollection} to fetch feature chunks.
 */
@SuppressWarnings("hiding")
protected void fetchFeatures(Query query, final FeatureResponseHandler handler) throws Exception {
    try {
        log.debug("fetchFeatures(): maxFeatures= " + query.getMaxFeatures());
        GetFeaturesRequest request = new GetFeaturesRequest(query);
        newExecutor().execute(pipeline, request, new ResponseHandler() {

            public void handle(ProcessorResponse r) throws Exception {
                GetFeaturesResponse response = (GetFeaturesResponse) r;
                handler.handle(response.getFeatures());
            }
        });
    } finally {
        handler.endOfResponse();
    }
}
Also used : GetFeaturesResponse(org.polymap.core.data.feature.GetFeaturesResponse) GetFeaturesRequest(org.polymap.core.data.feature.GetFeaturesRequest) ProcessorResponse(org.polymap.core.data.pipeline.ProcessorResponse) ResponseHandler(org.polymap.core.data.pipeline.ResponseHandler) IOException(java.io.IOException)

Example 2 with GetFeaturesRequest

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

the class FeatureRenameProcessor method featuresRequest.

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

Aggregations

GetFeaturesRequest (org.polymap.core.data.feature.GetFeaturesRequest)2 IOException (java.io.IOException)1 Query (org.geotools.data.Query)1 GetFeaturesResponse (org.polymap.core.data.feature.GetFeaturesResponse)1 ProcessorResponse (org.polymap.core.data.pipeline.ProcessorResponse)1 Produces (org.polymap.core.data.pipeline.Produces)1 ResponseHandler (org.polymap.core.data.pipeline.ResponseHandler)1