Package org.geotools.data.simple

Examples of org.geotools.data.simple.SimpleFeatureCollection.features()


            assertEquals(propNames.get(i), resultSchema.getDescriptor(i).getLocalName());
        }

        // the problem described in GEOT-408 arises in attribute reader, so
        // we must to try fetching features
        SimpleFeatureIterator iterator = results.features();
        SimpleFeature feature = iterator.next();
        iterator.close();
        assertNotNull(feature);

        // the id must be grabed correctly.
View Full Code Here


        SimpleFeatureSource source = ds.getFeatureSource(typeName);
        Query query = new Query(typeName, filter);
        SimpleFeatureCollection results = source.getFeatures(query);

        assertEquals(fids.size(), results.size());
        SimpleFeatureIterator iterator = results.features();
        try {
            while (iterator.hasNext()) {
                String fid = iterator.next().getID();
                assertTrue("a fid not included in query was returned: " + fid,
                        fids.contains(ff.featureId(fid)));
View Full Code Here

        SimpleFeatureSource source = ds.getFeatureSource(typeName);
        Query query = new Query(typeName, filter);
        SimpleFeatureCollection results = source.getFeatures(query);

        assertEquals(1, results.size());
        SimpleFeatureIterator iterator = results.features();
        try {
            while (iterator.hasNext()) {
                String fid = iterator.next().getID();
                assertTrue("a fid not included in query was returned: " + fid,
                        fids.contains(ff.featureId(fid)));
View Full Code Here

        SimpleFeatureSource source;
        source = store.getFeatureSource(typeName);
        SimpleFeatureCollection features;
        features = source.getFeatures(emptyAttNameFilter);

        SimpleFeatureIterator iterator = features.features();
        try {
            assertTrue(iterator.hasNext());
        } finally {
            iterator.close();
        }
View Full Code Here

        assertFalse(env2.isNull());
        env1 = results.getBounds();
        assertNotNull(env1);
        assertFalse(env1.isNull());

        SimpleFeatureIterator reader = results.features();
        assertTrue(reader.hasNext());

        try {
            assertNotNull(reader.next());
        } catch (NoSuchElementException ex) {
View Full Code Here

    private void testFilter(Filter filter, SimpleFeatureSource fsource, int expected)
            throws IOException {
        SimpleFeatureCollection fc = fsource.getFeatures(filter);

        SimpleFeatureIterator fi = fc.features();
        try {
            int numFeat = 0;
            while (fi.hasNext()) {
                fi.next();
                numFeat++;
View Full Code Here

        SimpleFeatureCollection features = fs.getFeatures(filter);
        assertNotNull(features);
        assertEquals(1, features.size());
        assertNull(fs.getBounds());

        SimpleFeatureIterator iterator = features.features();
        assertTrue(iterator.hasNext());
        SimpleFeature next = iterator.next();
        assertNotNull(next);
        assertFalse(iterator.hasNext());
        iterator.close();
View Full Code Here

        testFeatures = testData.createTestFeatures(LineString.class, featureCount);

        final DataStore ds = testData.getDataStore();

        final SimpleFeatureType ftype = testFeatures.getSchema();
        final SimpleFeatureIterator iterator = testFeatures.features();

        final Transaction transaction = new DefaultTransaction();
        final FeatureWriter<SimpleFeatureType, SimpleFeature> writer;
        writer = ds.getFeatureWriter(typeName, transaction);
View Full Code Here

        SimpleFeatureCollection features = store.getFeatures(oldValueFilter);
        final int initialSize = features.size();
        assertEquals(1, initialSize);// just to not go forward with bad data
        final SimpleFeature originalFeature;
        SimpleFeatureIterator iterator = features.features();
        try {
            originalFeature = iterator.next();
        } finally {
            iterator.close();
        }
View Full Code Here

        try {
            SimpleFeatureCollection features;
            SimpleFeatureIterator iterator;

            features = store.getFeatures(fid1Filter);
            iterator = features.features();
            final SimpleFeature feature1 = iterator.next();
            iterator.close();

            features = store.getFeatures(fid2Filter);
            iterator = features.features();
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.