Package org.geotools.feature.collection

Examples of org.geotools.feature.collection.FilteringSimpleFeatureCollection


            @DescribeParameter(name = "attribute", description = "Attribute to include in output", collectionType = String.class, min = 0) List<String> attributes,
            @DescribeParameter(name = "filter", min = 0, description = "The filter to apply") Filter filter)
            throws ProcessException {
        // apply filtering if necessary
        if (filter != null && !filter.equals(Filter.INCLUDE)) {
            features = new FilteringSimpleFeatureCollection(features, filter);
        }

        // apply retyping if necessary
        if (attributes != null && attributes.size() > 0) {
            final String[] names = (String[]) attributes.toArray(new String[attributes.size()]);
View Full Code Here


public class FilteringSimpleFeatureCollectionTest extends FeatureCollectionWrapperTestSupport {
    FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);

    public void testCount() {
        Filter filter = ff.equal(ff.property("someAtt"), ff.literal("1"), false);
        SimpleFeatureCollection collection = new FilteringSimpleFeatureCollection(delegate, filter);
        assertEquals(1, collection.size());
    }
View Full Code Here

        assertEquals(1, collection.size());
    }
   
    public void testVisitor() throws IOException {
        Filter filter = ff.equal(ff.property("someAtt"), ff.literal("1"), false);
        SimpleFeatureCollection collection = new FilteringSimpleFeatureCollection(delegate, filter);
        collection.accepts(new FeatureVisitor() {
           
            public void visit(Feature feature) {
                assertEquals(1, feature.getProperty("someAtt").getValue());
               
            }
View Full Code Here

        // step one: filter
        if( query.getFilter() != null && query.getFilter().equals(Filter.EXCLUDE)){
            return new EmptyFeatureCollection( getSchema() );
        }
        if (query.getFilter() != null && query.getFilter() != Filter.INCLUDE) {
            features = new FilteringSimpleFeatureCollection(features, query.getFilter());
        }
        // step two: reproject
        if (query.getCoordinateSystemReproject() != null) {
            features = new ReprojectingFeatureCollection(features, query
                    .getCoordinateSystemReproject());
View Full Code Here

            @DescribeParameter(name = "attribute", description = "The attribute name(s)", collectionType = String.class, min = 0) List<String> attributes,
            @DescribeParameter(name = "filter", min = 0, description = "Filters the input features") Filter filter)
            throws ProcessException {
        // apply filtering if necessary
        if (filter != null && !filter.equals(Filter.INCLUDE)) {
            features = new FilteringSimpleFeatureCollection(features, filter);
        }

        // apply retyping if necessary
        if (attributes != null && attributes.size() > 0) {
            final String[] names = (String[]) attributes.toArray(new String[attributes.size()]);
View Full Code Here

TOP

Related Classes of org.geotools.feature.collection.FilteringSimpleFeatureCollection

Copyright © 2018 www.massapicom. 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.