Examples of removeFeatures()


Examples of org.geotools.data.simple.SimpleFeatureStore.removeFeatures()

        assertEquals(type, reader.getFeatureType());
        assertEquals(1, count(reader));

        SimpleFeatureStore store = (SimpleFeatureStore) data.getFeatureSource("ROAD");
        store.setTransaction(t);
        store.removeFeatures(rd1Filter);

        reader = data.getFeatureReader(new Query("ROAD", Filter.EXCLUDE), t);
        assertEquals(0, count(reader));

        reader = data.getFeatureReader(new Query("ROAD"), t);
View Full Code Here

Examples of org.geotools.data.simple.SimpleFeatureStore.removeFeatures()

    }

    public void testGetFeatureStoreRemoveFeatures() throws IOException {
        SimpleFeatureStore road = (SimpleFeatureStore) data.getFeatureSource("ROAD");

        road.removeFeatures(rd1Filter);
        assertEquals(0, road.getFeatures(rd1Filter).size());
        assertEquals(roadFeatures.length - 1, road.getFeatures().size());
    }

    public void testGetFeatureStoreAddFeatures() throws IOException {
View Full Code Here

Examples of org.geotools.data.simple.SimpleFeatureStore.removeFeatures()

     */
    @Test
    public void testRemove() throws FileNotFoundException, IOException {
        DataStore csv = this.getDataStore();
        SimpleFeatureStore rows = (SimpleFeatureStore) csv.getFeatureSource( TYPE_NAME );
        rows.removeFeatures(this.newTestFilter());

        // re-open
        csv = this.getDataStore();
        rows = (SimpleFeatureStore) csv.getFeatureSource( TYPE_NAME );
        SimpleFeatureCollection features = rows.getFeatures();
View Full Code Here

Examples of org.geotools.data.simple.SimpleFeatureStore.removeFeatures()

    @Test
    public void testRemoveAll() throws FileNotFoundException, IOException {
        DataStore csv = this.getDataStore();
        SimpleFeatureStore rows = (SimpleFeatureStore) csv.getFeatureSource( TYPE_NAME );
        rows.removeFeatures(Filter.INCLUDE);

        // re-open
        csv = this.getDataStore();
        rows = (SimpleFeatureStore) csv.getFeatureSource( TYPE_NAME );
        SimpleFeatureCollection features = rows.getFeatures();
View Full Code Here

Examples of org.geotools.data.simple.SimpleFeatureStore.removeFeatures()

        assertEquals(type, reader.getFeatureType());
        assertEquals(1, count(reader));

        SimpleFeatureStore store = (SimpleFeatureStore) data.getFeatureSource(getRoadTypeName());
        store.setTransaction(t);
        store.removeFeatures(rd1Filter);

        reader = data.getFeatureReader(new Query(getRoadTypeName(), Filter.EXCLUDE), t);
        assertEquals(0, count(reader));

        reader = data.getFeatureReader(new Query(getRoadTypeName()), t);
View Full Code Here

Examples of org.geotools.data.simple.SimpleFeatureStore.removeFeatures()

    @Test
    public void testGetFeatureStoreRemoveFeatures() throws IOException {
        SimpleFeatureStore road = (SimpleFeatureStore) data.getFeatureSource(getRoadTypeName());

        road.removeFeatures(rd1Filter);
        assertEquals(0, road.getFeatures(rd1Filter).size());
        assertEquals(roadFeatures.length - 1, road.getFeatures().size());
    }

    @Test
View Full Code Here

Examples of org.geotools.data.simple.SimpleFeatureStore.removeFeatures()

    store.setTransaction(transaction);
   
    FilterFactory ff = CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints());
    Filter filter = ff.id(Collections.singleton(ff.featureId("fred")));
    try {
        store.removeFeatures(filter);
        transaction.commit();
    } catch (Exception eek) {
        transaction.rollback();
    }
    // removeExample end
View Full Code Here

Examples of org.geotools.data.simple.SimpleFeatureStore.removeFeatures()

        collection.accepts( new FeatureVisitor(){
            public void visit(Feature feature) {
                removed.add( feature.getIdentifier() );
            }
        }, null );
        store.removeFeatures(filter);
        transaction.commit();
    } catch (Exception eek) {
        transaction.rollback();
    }
    // removeExample2 end
View Full Code Here

Examples of org.geotools.data.simple.SimpleFeatureStore.removeFeatures()

        final FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();

        Filter filter = ff.equals(ff.property(aname("uuidProperty")), ff.literal(uuid1));
       
        featureStore.removeFeatures(filter);

        assertEquals(1, featureStore.getCount(Query.ALL));
    }

    public void testUUIDAsPrimaryKey() throws Exception {
View Full Code Here

Examples of org.geotools.data.simple.SimpleFeatureStore.removeFeatures()

    }

    public void testGetFeatureStoreRemoveFeatures() throws IOException {
        SimpleFeatureStore road = (SimpleFeatureStore) dataStore.getFeatureSource(tname("road"));

        road.removeFeatures(td.rd1Filter);
        assertEquals(0, road.getFeatures(td.rd1Filter).size());
        assertEquals(td.roadFeatures.length - 1, road.getFeatures().size());
    }

    public void testGetFeatureStoreRemoveAllFeatures()
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.