Examples of removeFeatures()


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

            throw new CommandFailedException("Can't write to the selected table");
        }
        SimpleFeatureStore featureStore = (SimpleFeatureStore) featureSource;
        if (overwrite) {
            try {
                featureStore.removeFeatures(Filter.INCLUDE);
            } catch (IOException e) {
                throw new CommandFailedException("Error accessing table: " + e.getMessage(), e);
            }
        }
        ExportOp op = cli.getGeogig().command(ExportOp.class).setFeatureStore(featureStore)
View Full Code Here

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

        }
        if (featureSource instanceof SimpleFeatureStore) {
            SimpleFeatureStore featureStore = (SimpleFeatureStore) featureSource;
            if (overwrite) {
                try {
                    featureStore.removeFeatures(Filter.INCLUDE);
                } catch (IOException e) {
                    throw new CommandFailedException("Error trying to remove features", e);
                }
            }
            ExportOp op = cli.getGeogig().command(ExportOp.class).setFeatureStore(featureStore)
View Full Code Here

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

                throw new CommandFailedException("Could not create feature store.");
            }
            final SimpleFeatureStore store = (SimpleFeatureStore) source;
            if (overwrite) {
                try {
                    store.removeFeatures(Filter.INCLUDE);
                } catch (IOException e) {
                    throw new CommandFailedException("Error truncating table " + tableName, e);
                }
            }
            ExportOp op = cli.getGeogig().command(ExportOp.class).setFeatureStore(store)
View Full Code Here

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

            // we're not getting rounding errors
            assertTrue(modif1.buffer(.01).contains(actual1));
            assertTrue(modif2.buffer(.01).contains(actual2));
        } finally {
            try {
                store.removeFeatures(fid1Filter);
                store.removeFeatures(fid2Filter);
            } catch (Exception e) {
                e.printStackTrace();
                throw e;
            }
View Full Code Here

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

            assertTrue(modif1.buffer(.01).contains(actual1));
            assertTrue(modif2.buffer(.01).contains(actual2));
        } finally {
            try {
                store.removeFeatures(fid1Filter);
                store.removeFeatures(fid2Filter);
            } catch (Exception e) {
                e.printStackTrace();
                throw e;
            }
        }
View Full Code Here

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

                    autoCommitReader.close();
                }
            }

            // now keep using the transaction, it should still work
            transFs.removeFeatures(filterNewFeature);

            // no features removed yet outside the transaction
            {
                FeatureReader<SimpleFeatureType, SimpleFeature> autoCommitReader;
                autoCommitReader = ds.getFeatureReader(newFeatureQuery, Transaction.AUTO_COMMIT);
View Full Code Here

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

        store.modifyFeatures(attribute, "modified", fidFilter);
        Filter modifiedFilter = ff.equals(ff.property("f"), ff.literal("modified"));
        assertEquals(2, count(ds, typeName, modifiedFilter));
       
        final int initialCount = store.getCount(Query.ALL);
        store.removeFeatures(fidFilter);
        final int afterCount = store.getCount(Query.ALL);
        assertEquals(initialCount - 2, afterCount);
        ds.dispose();
    }
   
View Full Code Here

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

        Id id = ff.id(Collections.singleton(ff.featureId(fid)));
       
        assertEquals(-1, store.getCount(new Query(typeName, id)));
        assertEquals(1, count(ds, typeName, id, t));
       
        store.removeFeatures(id);
       
        assertEquals(-1, store.getCount(new Query(store.getSchema().getTypeName(), id)));
        assertEquals(initialCount - 1, count(ds, typeName, Filter.INCLUDE, t));
        assertEquals(0, count(ds, typeName, id, t));
        ds.dispose();
View Full Code Here

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

        count(store, 2);
        FeatureId identifier = fid.iterator().next();
        String next = identifier.getID();
        FilterFactory filterFactory = CommonFactoryFinder.getFilterFactory(null);
        Filter f = filterFactory.id(Collections.singleton(filterFactory.featureId(next)));
        store.removeFeatures(f);
       
        count(store, 1);
//        assertEquals("Number of known feature as obtained from getCount",3, store.getCount(Query.ALL));
    }
View Full Code Here

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

        count1 ++; fr.next();
      }
        fr.close();

      System.out.println("Delete Remove "+ff);
      fs.removeFeatures(ff);

      System.out.println("Delete Read 2");
      fr = fs.getFeatures().features();
      int count2 = 0;
      while(fr.hasNext()){
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.