Package org.geotools.data.simple

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


    @Test
    public void testDeleteOnTransform() throws Exception {
        Filter f = CQL.toFilter("name = 'delaware'");
        SimpleFeatureStore transformed = (SimpleFeatureStore) transformWithPartialTransform();
        transformed.removeFeatures(f);

        // check it has been deleted
        int size = STATES.getCount(Query.ALL);
        assertEquals(9, size);
View Full Code Here


        assertEquals(0, STATES.getFeatures(f).size());
        assertEquals(0, transformed.getFeatures(f).size());
       
        // now remove everything else
        f = CQL.toFilter("people = total");
        transformed.removeFeatures(f);
        assertEquals(0, STATES.getFeatures(Query.ALL).size());
        assertEquals(0, transformed.getFeatures(Query.ALL).size());
    }
   
    @Test
View Full Code Here

            SimpleFeatureStore fs = null;
            try {
                // create a writer that appends this features
                fs = (SimpleFeatureStore) tileIndexStore.getFeatureSource(typeName);
                final int retVal = fs.getCount(query);
                fs.removeFeatures(query.getFilter());

                // update bounds
                bounds.put(typeName, tileIndexStore.getFeatureSource(typeName).getBounds());

                return retVal;
View Full Code Here

                    // We cannot grab the fids offline using AUTO_COMMIT
                    // because we may have removed some of them earlier
                    // in the transaction
                    //
                    locking.unLockFeatures(filter);
                    store.removeFeatures(filter);
                } else {
                    // This a bit better and what should be done, we
                    // will need to rework the gt2 locking api to work
                    // with fids or something
                    //
View Full Code Here

                        }
                    } finally {
                        writer.close();
                    }

                    store.removeFeatures(filter);
                }
            } else {
                // We don't have to worry about locking right now
              int deletedCount = store.getFeatures(filter).size();
              if(deletedCount > 0)
View Full Code Here

            } else {
                // We don't have to worry about locking right now
              int deletedCount = store.getFeatures(filter).size();
              if(deletedCount > 0)
                deleted += deletedCount;
                store.removeFeatures(filter);
            }
        } catch (IOException e) {
            String msg = e.getMessage();
            String eHandle = (String) EMFUtils.get(element, "handle");
            String code = null;
View Full Code Here

                    // We cannot grab the fids offline using AUTO_COMMIT
                    // because we may have removed some of them earlier
                    // in the transaction
                    //
                    locking.unLockFeatures(filter);
                    store.removeFeatures(filter);
                } else {
                    // This a bit better and what should be done, we
                    // will need to rework the gt2 locking api to work
                    // with fids or something
                    //
View Full Code Here

                        }
                    } finally {
                        writer.close();
                    }

                    store.removeFeatures(filter);
                }
            } else {
                // We don't have to worry about locking right now
              int deletedCount = store.getFeatures(filter).size();
              if(deletedCount > 0)
View Full Code Here

            } else {
                // We don't have to worry about locking right now
              int deletedCount = store.getFeatures(filter).size();
              if(deletedCount > 0)
                deleted += deletedCount;
                store.removeFeatures(filter);
            }
        } catch (IOException e) {
            String msg = e.getMessage();
            String eHandle = delete.getHandle();
            String code = null;
View Full Code Here

        final Query queryAll = new Query(RENAMED);

        SimpleFeatureStore store;
        store = (SimpleFeatureStore) rts.getFeatureSource(RENAMED);
        int count = store.getCount(queryAll);
        store.removeFeatures(fidFilter);

        assertEquals(count - 1, store.getCount(queryAll));
    }

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