Examples of modifyFeatures()


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

        FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
        PropertyIsEqualTo filter = ff.equals(ff.property(aname("name")), ff.literal("r1"));

        AttributeDescriptor name = td.roadType.getDescriptor(aname("name"));
        road.modifyFeatures(new AttributeDescriptor[] { name, }, new Object[] { "changed", }, filter);
    }

    public void testGetFeatureStoreRemoveFeatures() throws IOException {
        SimpleFeatureStore road = (SimpleFeatureStore) dataStore.getFeatureSource(tname("road"));
View Full Code Here

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

    // Feature Store Testing
    //
    public void testGetFeatureStoreModifyFeatures1() throws IOException {
        SimpleFeatureStore road = (SimpleFeatureStore) data.getFeatureSource("road");
        AttributeDescriptor name = roadType.getDescriptor("name");
        road.modifyFeatures(name, "changed", rd1Filter);

        SimpleFeatureCollection results = road.getFeatures(rd1Filter);
        assertEquals("changed", results.features().next().getAttribute("name"));
    }
View Full Code Here

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

    }

    public void testGetFeatureStoreModifyFeatures2() throws IOException {
        SimpleFeatureStore road = (SimpleFeatureStore) data.getFeatureSource("road");
        AttributeDescriptor name = roadType.getDescriptor("name");
        road.modifyFeatures(new AttributeDescriptor[]{name}, new Object[]{"changed",}, rd1Filter);

        SimpleFeatureCollection results = road.getFeatures(rd1Filter);
        assertEquals("changed", results.features().next().getAttribute("name"));
    }
    public void testGetFeatureStoreRemoveFeatures() throws IOException {
View Full Code Here

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

    @Test
    public void testUpdateOnSelection() throws Exception {
        SimpleFeatureStore transformed = (SimpleFeatureStore) transformWithSelection();
       
        // modify the feature
        transformed.modifyFeatures("persons", 0, CQL.toFilter("state_name = 'Illinois'"));
       
        // check it has been modified
        assertEquals(1, STATES.getFeatures(new Query(null, CQL.toFilter("persons = 0"))).size());
        SimpleFeatureCollection rfc = transformed.getFeatures(new Query(null, CQL.toFilter("persons = 0")));
        assertEquals(1, rfc.size());
View Full Code Here

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

    @Test
    public void testUpdateOnRename() throws Exception {
        SimpleFeatureStore transformed = (SimpleFeatureStore) transformWithRename();
       
        // modify the feature
        transformed.modifyFeatures("people", 0, CQL.toFilter("name = 'Illinois'"));
       
        // check it has been modified
        assertEquals(1, STATES.getFeatures(new Query(null, CQL.toFilter("persons = 0"))).size());
        SimpleFeatureCollection rfc = transformed.getFeatures(new Query(null, CQL.toFilter("people = 0")));
        assertEquals(1, rfc.size());
View Full Code Here

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

    @Test
    public void testUpdateOnTransform() throws Exception {
        SimpleFeatureStore transformed = (SimpleFeatureStore) transformWithPartialTransform();
       
        // modify the feature
        transformed.modifyFeatures("people", 0, CQL.toFilter("name = 'illinois'"));
       
        // check it has been modified
        assertEquals(1, STATES.getFeatures(new Query(null, CQL.toFilter("persons = 0"))).size());
        SimpleFeatureCollection rfc = transformed.getFeatures(new Query(null, CQL.toFilter("people = 0")));
        assertEquals(1, rfc.size());
View Full Code Here

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

        SimpleFeatureStore store;
        store = (SimpleFeatureStore) rts.getFeatureSource(RENAMED);
        SimpleFeature original = store.getFeatures(fidFilter).features().next();
        String newAddress = ((String) original.getAttribute("ADDRESS")) + " xxx";

        store.modifyFeatures(original.getFeatureType().getDescriptor("ADDRESS"), newAddress,
                fidFilter);
        SimpleFeature modified = store.getFeatures(fidFilter).features().next();
        assertEquals(newAddress, modified.getAttribute("ADDRESS"));
    }
View Full Code Here

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

            } finally {
                features.close(preprocess);
            }

            try {
                store.modifyFeatures(names, values, filter);
            } catch( Exception e) {
                //JD: this is a bit hacky but some of the wfs cite tests require
                // that the 'InvalidParameterValue' code be set on exceptions in
                // cases where a "bad" value is being suppliedin an update, so
                // we always set to that code
View Full Code Here

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

            } finally {
                preprocess.close();
            }

            try {
                store.modifyFeatures(names, values, filter);
            } catch( Exception e) {
                //JD: this is a bit hacky but some of the wfs cite tests require
                // that the 'InvalidParameterValue' code be set on exceptions in
                // cases where a "bad" value is being suppliedin an update, so
                // we always set to that code
View Full Code Here

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

        SimpleFeatureStore store;
        store = (SimpleFeatureStore) rts.getFeatureSource(RENAMED);
        SimpleFeature original = store.getFeatures(fidFilter).features().next();
        String newAddress = ((String) original.getAttribute("ADDRESS")) + " xxx";

        store.modifyFeatures(original.getFeatureType().getDescriptor("ADDRESS"), newAddress,
                fidFilter);
        SimpleFeature modified = store.getFeatures(fidFilter).features().next();
        assertEquals(newAddress, modified.getAttribute("ADDRESS"));
    }
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.