Search in sources :

Example 1 with WmsRenderProcessor

use of org.polymap.core.data.wms.WmsRenderProcessor in project polymap4-core by Polymap4.

the class P4ImageStoreInfo method canHandle.

/**
 * Returns a newly created {@link P4DataStoreInfo}, or null if the layer is not
 * connected to a {@link FeatureStore}.
 *
 * @throws Exception
 */
public static P4ImageStoreInfo canHandle(Catalog catalog, ILayer layer) throws Exception {
    GeoServerServlet server = GeoServerServlet.instance.get();
    Optional<Pipeline> pipeline = server.getOrCreatePipeline(layer, ImageProducer.class);
    if (pipeline.isPresent()) {
        if (!(pipeline.get().getLast().processor() instanceof WmsRenderProcessor)) {
            return null;
        }
        return new P4ImageStoreInfo(catalog, layer, pipeline.get());
    } else {
        return null;
    }
}
Also used : GeoServerServlet(org.polymap.service.geoserver.GeoServerServlet) WmsRenderProcessor(org.polymap.core.data.wms.WmsRenderProcessor) Pipeline(org.polymap.core.data.pipeline.Pipeline)

Aggregations

Pipeline (org.polymap.core.data.pipeline.Pipeline)1 WmsRenderProcessor (org.polymap.core.data.wms.WmsRenderProcessor)1 GeoServerServlet (org.polymap.service.geoserver.GeoServerServlet)1