use of org.polymap.core.data.feature.GetBoundsResponse in project polymap4-core by Polymap4.
the class RasterRenderProcessor method getBoundsRequest.
@Override
public void getBoundsRequest(GetBoundsRequest request, ProcessorContext context) throws Exception {
GeneralEnvelope envelope = reader.getOriginalEnvelope();
if (envelope != null) {
context.sendResponse(new GetBoundsResponse(new ReferencedEnvelope(envelope)));
return;
}
CoordinateReferenceSystem crs = reader.getCoordinateReferenceSystem();
if (crs != null) {
context.sendResponse(new GetBoundsResponse(new ReferencedEnvelope(crs)));
return;
}
throw new IllegalStateException("No bounds founds.");
}
use of org.polymap.core.data.feature.GetBoundsResponse in project polymap4-core by Polymap4.
the class WmsRenderProcessor method getBoundsRequest.
@Override
public void getBoundsRequest(GetBoundsRequest request, ProcessorContext context) throws Exception {
List<CRSEnvelope> bboxes = layer.getLayerBoundingBoxes();
// log.info( "BBOXES: " + bboxes );
ReferencedEnvelope result = new ReferencedEnvelope(FluentIterable.from(bboxes).first().get());
context.sendResponse(new GetBoundsResponse(result));
}
use of org.polymap.core.data.feature.GetBoundsResponse 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);
}
}
Aggregations