Examples of modifyFeatures()


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"));
    }
View Full Code Here

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

     */
    @Test
    public void testUpdate() throws FileNotFoundException, IOException {
        DataStore csv = this.getDataStore();
        SimpleFeatureStore rows = (SimpleFeatureStore) csv.getFeatureSource( TYPE_NAME );
        rows.modifyFeatures(NUMBER_COL, 333, this.newTestFilter());
       
        // re-open
        csv = this.getDataStore();
        rows = (SimpleFeatureStore) csv.getFeatureSource( TYPE_NAME );
        SimpleFeatureCollection features = rows.getFeatures();
View Full Code Here

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

   
    @Test
    public void testUpdateAll() throws FileNotFoundException, IOException {
        DataStore csv = this.getDataStore();
        SimpleFeatureStore rows = (SimpleFeatureStore) csv.getFeatureSource( TYPE_NAME );
        rows.modifyFeatures(NUMBER_COL, 333, Filter.INCLUDE);
       
        // re-open
        csv = this.getDataStore();
        rows = (SimpleFeatureStore) csv.getFeatureSource( TYPE_NAME );
        SimpleFeatureCollection features = rows.getFeatures();
View Full Code Here

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

   
    @Test
    public void testUpdateNone() throws FileNotFoundException, IOException {
        DataStore csv = this.getDataStore();
        SimpleFeatureStore rows = (SimpleFeatureStore) csv.getFeatureSource( TYPE_NAME );
        rows.modifyFeatures(NUMBER_COL, 333, Filter.EXCLUDE);
       
        // re-open
        csv = this.getDataStore();
        rows = (SimpleFeatureStore) csv.getFeatureSource( TYPE_NAME );
        SimpleFeatureCollection features = rows.getFeatures();
View Full Code Here

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

        count1 ++; oldValue=fr.next().getAttribute(attributeToChange);
      }

        fr.close();
      System.out.println("Update Modify");
      fs.modifyFeatures(at,newValue,Filter.INCLUDE);

      System.out.println("Update Read 2");
      fr = fs.getFeatures(f).features();
      int count2 = 0;
      while(fr.hasNext()){
View Full Code Here

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

            }
            fr.close();
            assertEquals(count2, count3);
        } finally {
            // cleanup
            fs.modifyFeatures(at, oldValue, Filter.INCLUDE);
            t.commit();
        }
    }
}
View Full Code Here

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

    //
    @Test
    public void testGetFeatureStoreModifyFeatures1() throws IOException {
        SimpleFeatureStore road = (SimpleFeatureStore) data.getFeatureSource(getRoadTypeName());
        Name name = roadType.getDescriptor(getNameAttribute()).getName();
        road.modifyFeatures(name, "changed", rd1Filter);

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

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

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

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

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

        // FilterFactory factory = FilterFactoryFinder.createFilterFactory();
        // rd1Filter = factory.createFidFilter( roadFeatures[0].getID() );
        Object changed = new Integer(5);
        AttributeDescriptor name = td.roadType.getDescriptor(aname("id"));
        road.modifyFeatures(name, changed, td.rd1Filter);

        SimpleFeatureCollection results = road.getFeatures(td.rd1Filter);
        SimpleFeatureIterator features = results.features();
        try {
            assertTrue(features.hasNext());
View Full Code Here

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

        //td.rd1Filter = factory.createFidFilter(td.roadFeatures[0].getID());
        Filter rd1Filter = factory.id(Collections.singleton(factory.featureId(
                        td.roadFeatures[0].getID())));

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

        SimpleFeatureCollection results = road.getFeatures(td.rd1Filter);
        SimpleFeatureIterator features = results.features();
        try {
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.