use of org.polymap.core.data.PipelineFeatureSource in project polymap4-core by Polymap4.
the class PipelineReadTest method testCount.
@Test
public void testCount() throws IOException {
PipelineFeatureSource fs = pipeDs.getFeatureSource();
Query query = Query.ALL;
assertEquals(expected.COUNT, fs.getCount(query));
query = new Query(null, Filter.INCLUDE);
assertEquals(expected.COUNT, fs.getCount(query));
query = new Query(null, Filter.EXCLUDE);
assertEquals(0, /*origFs.getCount( query )*/
fs.getCount(query));
}
use of org.polymap.core.data.PipelineFeatureSource in project polymap4-core by Polymap4.
the class PipelineReadTest method testBounds.
@Test
public void testBounds() throws IOException {
PipelineFeatureSource fs = pipeDs.getFeatureSource();
Query query = Query.ALL;
assertEquals(expected.BOUNDS, fs.getBounds(query));
query = new Query(null, Filter.INCLUDE);
assertEquals(expected.BOUNDS, fs.getBounds(query));
query = new Query(null, Filter.EXCLUDE);
assertEquals(null, fs.getBounds(query));
}
use of org.polymap.core.data.PipelineFeatureSource in project polymap4-core by Polymap4.
the class P4DataStoreInfo method canHandle.
/**
* Returns a newly created {@link P4DataStoreInfo}, or null if the layer is not
* connected to a {@link FeatureStore}.
*
* @throws Exception
*/
public static P4DataStoreInfo canHandle(Catalog catalog, ILayer layer) throws Exception {
GeoServerServlet server = GeoServerServlet.instance.get();
Optional<Pipeline> pipeline = server.getOrCreatePipeline(layer, FeaturesProducer.class);
if (pipeline.isPresent()) {
PipelineFeatureSource fs = new PipelineDataStore(pipeline.get()).getFeatureSource();
// check with P4FeatureTypeInfo
Name name = new NameImpl(GeoServerUtils.defaultNsInfo.get().getName(), GeoServerUtils.simpleName(layer.label.get()));
Params params = new Params();
FeatureRenameProcessor.NAME.rawput(params, name);
PipelineProcessorSite procSite = new PipelineProcessorSite(params);
ProcessorDescriptor proc = new ProcessorDescriptor(FeatureRenameProcessor.class, params);
proc.processor().init(procSite);
fs.pipeline().addFirst(proc);
return new P4DataStoreInfo(catalog, layer, fs);
} else {
return null;
}
}
Aggregations