}
// okay now we will do a query for everything in the added or modified bounds
FeatureSource<SimpleFeatureType, SimpleFeature> source = notifierLayer.getResource(FeatureSource.class, ProgressManager.instance().get());
SimpleFeatureType schema=source.getSchema();
FilterFactory fac=CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints());
final List<String> queryAtts = obtainQueryAttributesForFeatureTable(schema);
final DefaultQuery query=new DefaultQuery(schema.getName().getLocalPart(), Filter.EXCLUDE, queryAtts.toArray(new String[0]));
String name = schema.getGeometryDescriptor().getName().getLocalPart();
// add new features
if( addedBounds!=null ){
double minx=addedBounds.getMinX();
double miny=addedBounds.getMinY();
double maxx=addedBounds.getMaxX();
double maxy=addedBounds.getMaxY();
String srs=CRS.lookupIdentifier(schema.getCoordinateReferenceSystem(), false);
BBOX bboxFilter = fac.bbox(name, minx, miny, maxx, maxy, srs);
query.setFilter(bboxFilter);
FeatureCollection<SimpleFeatureType, SimpleFeature> features = source.getFeatures(query);
this.table.update(features);
}
// update modified features
if( modifiedBounds!=null ){
double minx=modifiedBounds.getMinX();
double miny=modifiedBounds.getMinY();
double maxx=modifiedBounds.getMaxX();
double maxy=modifiedBounds.getMaxY();
String srs=CRS.lookupIdentifier(schema.getCoordinateReferenceSystem(), false);
BBOX bboxFilter = fac.bbox(name, minx, miny, maxx, maxy, srs);
query.setFilter(bboxFilter);
FeatureCollection<SimpleFeatureType, SimpleFeature> features = source.getFeatures(query);
this.table.update(features);
}