Examples of removeFeatures()


Examples of org.geotools.data.VersioningFeatureStore.removeFeatures()

        // modify the fourth feature, change its cat from 400 to 450
        Id updateFilter = ff.id(singleton(ff.featureId("restricted.1b99be2b-2480-4742-ad52-95c294efda3b")));
        restricted.modifyFeatures(schema.getDescriptor("cat"), 450, updateFilter);
        // remove the third feature
        Id removeFilter = ff.id(singleton(ff.featureId("restricted.c15e76ab-e44b-423e-8f85-f6d9927b878a")));
        restricted.removeFeatures(removeFilter);
        assertEquals(3, restricted.getCount(Query.ALL));
       

        // get the response and do the basic checks
        MockHttpServletResponse response = postAsServletResponse(root(true),
View Full Code Here

Examples of org.geotools.data.VersioningFeatureStore.removeFeatures()

        // remove
        Id removeFilter = ff.id(singleton(ff
                .featureId("restricted.d91fe390-bdc7-4b22-9316-2cd6c8737ef5")));
        Transaction t = new DefaultTransaction();
        restricted.setTransaction(t);
        restricted.removeFeatures(removeFilter);
        String v1 = restricted.getVersion();
        t.commit();

        // revert
        String v2 = restricted.getVersion();
View Full Code Here

Examples of org.geotools.data.VersioningFeatureStore.removeFeatures()

        // make the same changes as in the post diff
        Id updateFilter = ff.id(singleton(ff.featureId("restricted.be7cafea-d0b7-4257-9b9c-1ed3de3f7ef4")));
        restricted.modifyFeatures(schema.getDescriptor("cat"), -48, updateFilter);
        // remove the third feature
        Id removeFilter = ff.id(singleton(ff.featureId("restricted.d91fe390-bdc7-4b22-9316-2cd6c8737ef5")));
        restricted.removeFeatures(removeFilter);
        assertEquals(3, restricted.getCount(Query.ALL));
       

        // get the response and do the basic checks
        MockHttpServletResponse response = postAsServletResponse(root(true),
View Full Code Here

Examples of org.geotools.data.VersioningFeatureStore.removeFeatures()

        // modify the fourth feature, change its cat from 400 to 450
        Id updateFilter = ff.id(singleton(ff.featureId("restricted.1b99be2b-2480-4742-ad52-95c294efda3b")));
        restricted.modifyFeatures(schema.getDescriptor("cat"), 450, updateFilter);
        // remove the third feature
        Id removeFilter = ff.id(singleton(ff.featureId("restricted.c15e76ab-e44b-423e-8f85-f6d9927b878a")));
        restricted.removeFeatures(removeFilter);
        assertEquals(3, restricted.getCount(Query.ALL));
       
        // execute the postDiff
        MockHttpServletResponse response = postAsServletResponse(root(true),
                loadTextResource("PostDiffInitial.xml"));
View Full Code Here

Examples of org.geotools.data.VersioningFeatureStore.removeFeatures()

    protected void setUp() throws Exception {
        super.setUp();
       
        // create a feature store
        VersioningFeatureStore mockStore = createNiceMock(VersioningFeatureStore.class);
        mockStore.removeFeatures(Filter.INCLUDE);
        expect(mockStore.getSchema()).andReturn(DataUtilities.createType(SCHEMA, "id:int"));
        replay(mockStore);

        // create a data store
        mock = createNiceMock(VersioningDataStore.class);
View Full Code Here

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

      Filter filter = filterService.createFidFilter(new String[] {featureId});
      if (transactionManager != null) {
        store.setTransaction(transactionManager.getTransaction());
      }
      try {
        store.removeFeatures(filter);
        if (log.isDebugEnabled()) {
          log.debug("Deleted feature {} in {}", featureId, getFeatureSourceName());
        }
      } catch (IOException ioe) {
        featureModelUsable = false;
View Full Code Here

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

 
          LOGGER.debug("Filter: " + filter);

            // try to look for the destination table
            SimpleFeatureStore store = (SimpleFeatureStore) ds.getFeatureSource(layer);
            store.removeFeatures(filter);
            tx.commit();
        } catch (Exception e) {
            quietRollbackTransaction(tx);
            LOGGER.error("An exception was raised when deleting features from " + layer + "", e);
            throw new PostGisException("An exception was raised when deleting features from " + layer, e);
View Full Code Here

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 truncating 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()

                    throw new CommandFailedException(
                            "Could not create feature store. Data source is read only.");
                }
                final SimpleFeatureStore featureStore = (SimpleFeatureStore) featureSource;
                if (overwrite) {
                    featureStore.removeFeatures(Filter.INCLUDE);
                }
                ExportOp op = cli.getGeogig().command(ExportOp.class).setFeatureStore(featureStore)
                        .setPath(path).setFeatureTypeConversionFunction(function);
                try {
                    op.setProgressListener(cli.getProgressListener()).call();
View Full Code Here

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