public void removeFeatures(Filter filter) throws IOException { // are we limiting anything? Query writeQuery = getWriteQuery(policy); if (writeQuery == Query.ALL) { storeDelegate.removeFeatures(filter); } else if (writeQuery.getFilter() == Filter.EXCLUDE || writeQuery.getPropertyNames() == Query.NO_NAMES) { throw unsupportedOperation(); } // get the mixed filter final Query local = new Query(null, filter); Query mixed = mixQueries(local, writeQuery); storeDelegate.removeFeatures(mixed.getFilter()); }
public void removeFeatures(Filter filter) throws IOException { delegate().removeFeatures(filter); }
public void removeFeatures(Filter filter) throws IOException { wrappedStore.removeFeatures(filter); }
public void removeFeatures(Filter filter) throws IOException { fstore.removeFeatures(filter); }
public void removeFeatures(Filter filter) throws IOException { delegate().removeFeatures(filter); }
protected synchronized void clearMemoryLayer() { try { FeatureStore<SimpleFeatureType, SimpleFeature> fst = (FeatureStore<SimpleFeatureType, SimpleFeature>) memoryLayer.getFeatureSource(); fst.removeFeatures(Filter.INCLUDE); fst = (FeatureStore<SimpleFeatureType, SimpleFeature>) edgesLayer.getFeatureSource(); fst.removeFeatures(Filter.INCLUDE); } catch (Exception e) { e.printStackTrace(); } map2D.repaintMemoryDecoration(); }
@DeleteMapping(path = "{product:.+}") public void deleteProduct( @PathVariable(required = true, name = "collection") String collection, @PathVariable(name = "product", required = true) String product) throws IOException { // check the product exists queryProduct(collection, product, q -> {}); // TODO: handle removing the publishing side without removing the metadata Filter filter = getProductFilter(collection, product); runTransactionOnProductStore(fs -> fs.removeFeatures(filter)); }
@DeleteMapping(path = "{product:.+}/granules") public void putProductGranules( @PathVariable(name = "collection", required = true) String collection, @PathVariable(name = "product", required = true) String product) throws IOException { SimpleFeatureStore store = (SimpleFeatureStore) getOpenSearchAccess().getGranules(collection, product); runTransactionOnStore( store, s -> { s.removeFeatures(Filter.INCLUDE); }); }
@PutMapping( path = "{product:.+}/granules", produces = {MediaType.APPLICATION_JSON_VALUE} ) public void putProductGranules( @PathVariable(name = "collection", required = true) String collection, @PathVariable(name = "product", required = true) String product, @RequestBody SimpleFeatureCollection granules) throws IOException { SimpleFeatureStore store = (SimpleFeatureStore) getOpenSearchAccess().getGranules(collection, product); runTransactionOnStore( store, s -> { s.removeFeatures(Filter.INCLUDE); s.addFeatures(granules); }); }
@DeleteMapping(path = "{collection}") public void deleteCollection( @PathVariable(required = true, name = "collection") String collection) throws IOException { // check the collection exists queryCollection(collection, q -> {}); // TODO: handle cascading on products, and removing the publishing side without removing the // metadata Filter filter = FF.equal(FF.property(COLLECTION_ID), FF.literal(collection), true); runTransactionOnCollectionStore(fs -> fs.removeFeatures(filter)); }
public void testGetFeatureStoreRemoveFeatures() throws IOException { FeatureStore road = (FeatureStore) data.getFeatureSource("ROAD"); road.removeFeatures(rd1Filter); assertEquals(0, road.getFeatures(rd1Filter).size()); assertEquals(roadFeatures.length - 1, road.getFeatures().size()); }
@Test public void testFullAccess() throws Exception { FeatureSource source = getFeatureSource(MockData.LINES); FeatureCollection fc = source.getFeatures(); FeatureStore store = (FeatureStore) source; store.removeFeatures(Filter.INCLUDE); }
@Test public void testCannotWrite() throws Exception { FeatureStore fs = (FeatureStore) getFeatureSource(MockData.DELETES); try { fs.removeFeatures(Filter.INCLUDE); fail("This should have failed with a security exception!"); } catch (Exception e) { if (ReadOnlyDataStoreTest.isSpringSecurityException(e) == false) fail("Should have failed with a security exception"); } } }
Id fidFilter = ff.id(Collections.singleton(ff.featureId(feature.getID()))); store1.removeFeatures(fidFilter);
@Before public void cleanupTestCollection() throws IOException { DataStoreInfo ds = getCatalog().getDataStoreByName("oseo"); OpenSearchAccess access = (OpenSearchAccess) ds.getDataStore(null); FeatureStore store = (FeatureStore) access.getCollectionSource(); store.removeFeatures( FF.equal( FF.property(new NameImpl(OpenSearchAccess.EO_NAMESPACE, "identifier")), FF.literal("TEST123"), true)); }
fs.removeFeatures(Filter.INCLUDE);
fs.removeFeatures(Filter.INCLUDE);
@Before public void cleanupTestProduct() throws IOException { DataStoreInfo ds = getCatalog().getDataStoreByName("oseo"); OpenSearchAccess access = (OpenSearchAccess) ds.getDataStore(null); FeatureStore store = (FeatureStore) access.getProductSource(); store.removeFeatures( FF.and( FF.equal( FF.property(new NameImpl(GENERIC.getPrefix(), "parentIdentifier")), FF.literal("SENTINEL2"), true), FF.equal( FF.property(new NameImpl(GENERIC.getPrefix(), "identifier")), FF.literal(PRODUCT_CREATE_UPDATE_ID), true))); store.removeFeatures( FF.and( FF.equal( FF.property(new NameImpl(GENERIC.getPrefix(), "parentIdentifier")), FF.literal("SAS1"), true), FF.equal( FF.property(new NameImpl(GENERIC.getPrefix(), "identifier")), FF.literal(PRODUCT_ATM_CREATE_UPDATE_ID), true))); }
store.removeFeatures(rd1Filter);
road1.removeFeatures(rd1Filter);