Examples of ForwardingFeatureSource


Examples of org.locationtech.geogig.api.data.ForwardingFeatureSource

            featureSource = dataStore.getFeatureSource(typeName);
        } catch (Exception e) {
            throw new GeoToolsOpException(StatusCode.UNABLE_TO_GET_FEATURES);
        }

        return new ForwardingFeatureSource(featureSource) {

            @Override
            public FeatureCollection getFeatures(Query query) throws IOException {

                final FeatureCollection features = super.getFeatures(query);
View Full Code Here

Examples of org.locationtech.geogig.api.data.ForwardingFeatureSource

        store.addFeatures(features);

        final QueryCapabilities caps = mock(QueryCapabilities.class);
        when(caps.isOffsetSupported()).thenReturn(true);

        FeatureSource source = new ForwardingFeatureSource(store.getFeatureSource(pointsName)) {
            @Override
            public QueryCapabilities getQueryCapabilities() {
                return caps;
            }

            @Override
            public FeatureCollection getFeatures(Query query) throws IOException {
                Integer startIndex = query.getStartIndex();
                if (startIndex == null) {
                    return super.getFeatures();
                }
                int toIndex = (int) Math.min((long) startIndex + query.getMaxFeatures(),
                        features.size());
                List<SimpleFeature> result = features.subList(startIndex, toIndex);
                return DataUtilities.collection(result);
            }
        };

        assertTrue(source.getQueryCapabilities().isOffsetSupported());

        String treePath = "target_typename";
        workTree.insert(treePath, source, Query.ALL, LISTENER);

        assertEquals(3, workTree.countUnstaged(treePath).featureCount());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.