private FeatureIterator<SimpleFeature> getAffectedFeatures(SimpleFeature feature) throws IOException {
FilterFactory2 filterFactory = CommonFactoryFinder.getFilterFactory2(GeoTools.getDefaultHints());
String geomAttName = feature.getFeatureType().getGeometryDescriptor().getLocalName();
PropertyName geomPropertyExpression = filterFactory.property(geomAttName);
Literal literalGeomExpression = filterFactory.literal(feature.getDefaultGeometry());
Touches filter = filterFactory.touches(geomPropertyExpression, literalGeomExpression);
IProgressMonitor monitor =
getContext().getActionBars().getStatusLineManager().getProgressMonitor();
FeatureSource<SimpleFeatureType,SimpleFeature> resource =
getContext().getSelectedLayer().getResource(FeatureSource.class, monitor);