Examples of modifyFeatures()


Examples of org.geotools.data.FeatureStore.modifyFeatures()

                        preprocess.close();
                    }
                   
                    try{
                      if (types.length == 1) {
                          store.modifyFeatures(types[0], values[0], filter);
                      } else {
                          store.modifyFeatures(types, values, filter);
                      }
                }catch (IOException e//DJB: this is for cite tests.  We should probaby do this for all the exceptions here - throw a transaction FAIL instead of serice exception 
        {
View Full Code Here

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

        // grab the datastore
        VersioningFeatureStore restricted = (VersioningFeatureStore) synchStore.getFeatureSource("restricted");
        SimpleFeatureType schema = restricted.getSchema();
        // 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));
       
View Full Code Here

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

    public void testUpdateConflict() throws Exception {
        // grab the datastore so that we can make some changes that will generate conflicts
        VersioningFeatureStore restricted = (VersioningFeatureStore) synchStore.getFeatureSource("restricted");
        SimpleFeatureType schema = restricted.getSchema();
        Id fidFilter = ff.id(singleton(ff.featureId("restricted.be7cafea-d0b7-4257-9b9c-1ed3de3f7ef4")));
        restricted.modifyFeatures(schema.getDescriptor("cat"), 123456, fidFilter);
        assertEquals(4, restricted.getCount(Query.ALL));
    
        // get the response and do the basic checks
        MockHttpServletResponse response = postAsServletResponse(root(true),
                loadTextResource("PostDiffInitial.xml"));
View Full Code Here

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

        SimpleFeatureType schema = restricted.getSchema();

        // an update
        Id updateFilter = ff.id(singleton(ff
                .featureId("restricted.be7cafea-d0b7-4257-9b9c-1ed3de3f7ef4")));
        restricted.modifyFeatures(schema.getDescriptor("cat"), -48, updateFilter);
        // a delete
        Id removeFilter = ff.id(singleton(ff
                .featureId("restricted.d91fe390-bdc7-4b22-9316-2cd6c8737ef5")));
        restricted.removeFeatures(removeFilter);
        // and an insert
View Full Code Here

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

        // grab the datastore so that we can make some changes that will not generate conflicts
        VersioningFeatureStore restricted = (VersioningFeatureStore) synchStore.getFeatureSource("restricted");
        SimpleFeatureType schema = restricted.getSchema();
        // 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));
       
View Full Code Here

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

        // first update
        Id updateFilter = ff.id(singleton(ff
                .featureId("restricted.be7cafea-d0b7-4257-9b9c-1ed3de3f7ef4")));
        Transaction t = new DefaultTransaction();
        restricted.setTransaction(t);
        restricted.modifyFeatures(schema.getDescriptor("cat"), -48, updateFilter);
        String v1 = restricted.getVersion();
        t.commit();
       
        // second update
        WKTReader wkt = new WKTReader();
View Full Code Here

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

        t.commit();
       
        // second update
        WKTReader wkt = new WKTReader();
        Geometry g = wkt.read("MULTIPOLYGON(((0 0, 0 10, 10 10, 10 0, 0 0)))");
        restricted.modifyFeatures(schema.getDescriptor("the_geom"), g, updateFilter);
        String v2 = restricted.getVersion();
        t.commit();
       
        // clean up
        t.close();
View Full Code Here

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

        // grab the datastore
        VersioningFeatureStore restricted = (VersioningFeatureStore) synchStore.getFeatureSource("restricted");
        SimpleFeatureType schema = restricted.getSchema();
        // 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));
       
View Full Code Here

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

        // grab the datastore so that we can make some changes that will not generate conflicts
        VersioningFeatureStore restricted = (VersioningFeatureStore) synchStore.getFeatureSource("restricted");
        SimpleFeatureType schema = restricted.getSchema();
        // 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));
       
View Full Code Here

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

    public void testConflicts() throws Exception {
        VersioningFeatureStore restricted = (VersioningFeatureStore) synchStore.getFeatureSource("restricted");
        SimpleFeatureType schema = restricted.getSchema();
        // 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);
        // a update that will generate a conflict
        updateFilter = ff.id(singleton(ff.featureId("restricted.d91fe390-bdc7-4b22-9316-2cd6c8737ef5")));
        restricted.modifyFeatures(schema.getDescriptor("cat"), 347, updateFilter);
        // an update that will generate a clean merge
        updateFilter = ff.id(singleton(ff.featureId("restricted.be7cafea-d0b7-4257-9b9c-1ed3de3f7ef4")));
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.