Examples of removeFeatures()


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

    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

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

        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

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

            // 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

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

    @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

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

    @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

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

    @Test
    public void testDeleteOnTransform() throws Exception {
        Filter f = CQL.toFilter("name = 'delaware'");
        SimpleFeatureStore transformed = (SimpleFeatureStore) transformWithPartialTransform();
        transformed.removeFeatures(f);

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

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

        assertEquals(0, STATES.getFeatures(f).size());
        assertEquals(0, transformed.getFeatures(f).size());
       
        // now remove everything else
        f = CQL.toFilter("people = total");
        transformed.removeFeatures(f);
        assertEquals(0, STATES.getFeatures(Query.ALL).size());
        assertEquals(0, transformed.getFeatures(Query.ALL).size());
    }
   
    @Test
View Full Code Here

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

            SimpleFeatureStore fs = null;
            try {
                // create a writer that appends this features
                fs = (SimpleFeatureStore) tileIndexStore.getFeatureSource(typeName);
                final int retVal = fs.getCount(query);
                fs.removeFeatures(query.getFilter());

                // update bounds
                bounds.put(typeName, tileIndexStore.getFeatureSource(typeName).getBounds());

                return retVal;
View Full Code Here

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

                    // We cannot grab the fids offline using AUTO_COMMIT
                    // because we may have removed some of them earlier
                    // in the transaction
                    //
                    locking.unLockFeatures(filter);
                    store.removeFeatures(filter);
                } else {
                    // This a bit better and what should be done, we
                    // will need to rework the gt2 locking api to work
                    // with fids or something
                    //
View Full Code Here

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

                        }
                    } finally {
                        writer.close();
                    }

                    store.removeFeatures(filter);
                }
            } else {
                // We don't have to worry about locking right now
              int deletedCount = store.getFeatures(filter).size();
              if(deletedCount > 0)
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.