Search in sources :

Example 1 with GetBoundsRequest

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

the class FeatureRenameProcessor method boundsRequest.

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

Example 2 with GetBoundsRequest

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

the class PipelineFeatureSource method getBoundsInternal.

@Override
@SuppressWarnings("hiding")
protected ReferencedEnvelope getBoundsInternal(Query query) throws IOException {
    try {
        GetBoundsRequest request = new GetBoundsRequest(query);
        AtomicReference<ReferencedEnvelope> result = new AtomicReference();
        newExecutor().execute(pipeline, request, (GetBoundsResponse r) -> {
            result.set(r.bounds.get());
        });
        return result.get();
    } catch (Exception e) {
        Throwables.propagateIfInstanceOf(e, IOException.class);
        throw Throwables.propagate(e);
    }
}
Also used : ReferencedEnvelope(org.geotools.geometry.jts.ReferencedEnvelope) GetBoundsRequest(org.polymap.core.data.feature.GetBoundsRequest) AtomicReference(java.util.concurrent.atomic.AtomicReference) GetBoundsResponse(org.polymap.core.data.feature.GetBoundsResponse) IOException(java.io.IOException) IOException(java.io.IOException)

Aggregations

GetBoundsRequest (org.polymap.core.data.feature.GetBoundsRequest)2 IOException (java.io.IOException)1 AtomicReference (java.util.concurrent.atomic.AtomicReference)1 Query (org.geotools.data.Query)1 ReferencedEnvelope (org.geotools.geometry.jts.ReferencedEnvelope)1 GetBoundsResponse (org.polymap.core.data.feature.GetBoundsResponse)1 Produces (org.polymap.core.data.pipeline.Produces)1