Package org.geotools.feature

Examples of org.geotools.feature.FeatureCollection.features()


        FeatureSource fSource = (FeatureSource) dataAccess.getFeatureSource(typeName);
        FeatureCollection features = (FeatureCollection) fSource.getFeatures();

        assertEquals(5, size(features));

        FeatureIterator iterator = features.features();
        while (iterator.hasNext()) {
            Feature next = iterator.next();
            Collection<Property> children = next.getProperties("nestedFeature");
            if (next.getIdentifier().toString().equals("cc.1")) {
                // _=STRING:String,LINK_ONE:String,LINK_TWO:String
View Full Code Here


        fSource = (FeatureSource) dataAccess.getFeatureSource(typeName);
        features = (FeatureCollection) fSource.getFeatures();

        assertEquals(5, size(features));

        iterator = features.features();
        while (iterator.hasNext()) {
            Feature next = iterator.next();
            Collection<Property> children = next.getProperties("nestedFeature");
            if (next.getIdentifier().toString().equals("cc.2")) {
                // _=STRING:String,LINK_ONE:String,LINK_TWO:String
View Full Code Here

        // copy unrolled filter
        ((MappingFeatureCollection) collection).setUnrolledFilter(instance.baseTableQuery
                .getFilter());

        FeatureIterator featureIterator = collection.features();

        if (!(featureIterator instanceof DataAccessMappingFeatureIterator)) {
            throw new IOException(
                    "Internal error: Data Access Mapping feature Iterator expected but found "
                            + featureIterator);
View Full Code Here

        for (int i = 0; i < 2; i++) {
            Geometry expected = gf.createPoint(new Coordinate(i, i)).buffer(10d);
            FeatureCollection sub = buffered.subCollection(ff.equals(ff.property("integer"),
                    ff.literal(i)));
            assertEquals(1, sub.size());
            FeatureIterator iterator = sub.features();
            SimpleFeature sf = (SimpleFeature) iterator.next();
            assertTrue(expected.equals((Geometry) sf.getDefaultGeometry()));
            iterator.close();
        }
    }
View Full Code Here

        FeatureCollection features = getFeatures(Query.DEFAULT_MAX, inputFilter);
        assertEquals(1, DataUtilities.count(features));
       
        // check that it returns the right feature
        FeatureIterator iterator = features.features();
        Feature f = iterator.next();
        assertEquals(f.getIdentifier().toString(), "lithostratigraphic.unit.1679161041155866313");       
        iterator.close();    
    }
View Full Code Here

       
        FeatureCollection features = getFeatures(Query.DEFAULT_MAX, inputFilter);
        assertEquals(3, DataUtilities.count(features));
       
        // check feature ids
        FeatureIterator iterator = features.features();
        Feature f = iterator.next();
        assertEquals(f.getIdentifier().toString(), "lithostratigraphic.unit.1679161021439131319");
        assertTrue(iterator.hasNext());
        f = iterator.next();           
        assertEquals(f.getIdentifier().toString(), "lithostratigraphic.unit.1679161041155866313")
View Full Code Here

       
        // now with maxFeatures = 1, it should only return the first one
        features = getFeatures(MAX_FEATURES, inputFilter);
        assertEquals(MAX_FEATURES, DataUtilities.count(features));
       
        iterator = features.features();
        f = iterator.next();
        assertEquals(f.getIdentifier().toString(), "lithostratigraphic.unit.1679161021439131319");
       
        iterator.close();   
    }
View Full Code Here

        FeatureCollection features = getFeatures(MAX_FEATURES, filter);
       
        assertEquals(0, DataUtilities.count(features));

        List<Feature> results = new ArrayList<Feature>();
        FeatureIterator it = features.features();
        for (; it.hasNext();) {
            results.add((Feature) it.next());
        }
        it.close();
        assertEquals(0, results.size());
View Full Code Here

        final Name GeologicUnitType = new NameImpl(FeatureChainingTest.GSMLNS, "GeologicUnitType");

        List<Feature> results = new ArrayList<Feature>();

        FeatureCollection features = getFeatures(Query.DEFAULT_MAX, Filter.INCLUDE);
        FeatureIterator it = features.features();
        for (; it.hasNext();) {
            results.add((Feature) it.next());
        }
        it.close();
       
View Full Code Here

        assertEquals( 1, fc.getFeature().size() );
       
        FeatureCollection features = (FeatureCollection) fc.getFeature().get( 0 );
        assertEquals( 2, features.size() );
       
        FeatureIterator fi = features.features();
        try {
            assertTrue( fi.hasNext() );
            SimpleFeature f = (SimpleFeature) fi.next();
           
            assertEquals( "feature", f.getType().getTypeName() );
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.