Package org.geotools.data.simple

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


    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

        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

        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

    }

    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

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

        road.removeFeatures(Filter.INCLUDE);
        assertEquals(0, road.getFeatures().size());
    }

    public void testGetFeatureStoreAddFeatures() throws IOException {
         FeatureReader<SimpleFeatureType, SimpleFeature> reader = DataUtilities.reader(new SimpleFeature[] { td.newRoad, });
View Full Code Here

        assertEquals("changed", results.features().next().getAttribute("name"));
    }
    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 {
         FeatureReader<SimpleFeatureType, SimpleFeature> reader = DataUtilities.reader(new SimpleFeature[]{newRoad,});
View Full Code Here

            // check if the index has been cleared
            checkStore();

            final SimpleFeatureStore store = (SimpleFeatureStore) slicesIndexStore.getFeatureSource(typeName);
            store.setTransaction(transaction);
            store.removeFeatures(filter);

        } finally {
            lock.unlock();
        }
    }
View Full Code Here

    @Test
    public void testDeleteOnSelection() throws Exception {
        Filter f = CQL.toFilter("state_name = 'Delaware'");
        SimpleFeatureStore transformed = (SimpleFeatureStore) transformWithSelection();
        transformed.removeFeatures(f);

        // check it has been deleted
        int size = STATES.getCount(Query.ALL);
        assertEquals(9, size);
View Full Code Here

    @Test
    public void testDeleteOnRename() throws Exception {
        Filter f = CQL.toFilter("name = 'Delaware'");
        SimpleFeatureStore transformed = (SimpleFeatureStore) transformWithRename();
        transformed.removeFeatures(f);

        // check it has been deleted
        int size = STATES.getCount(Query.ALL);
        assertEquals(9, size);
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.