public void execute(List<Feature> features) {
List<Geometry> geometries = new ArrayList<Geometry>();
for (Feature feature : features) {
Geometry geometry = feature.getGeometry();
// For MultiPolygons and MultiLinestrings, we calculate bounds intersection
// for each partial geometry. This way we can send parts of the complex
// geometries to the snapping list, and not always the entire geometry.(=faster)
if (geometry instanceof MultiLineString || geometry instanceof MultiPoint
|| geometry instanceof MultiPolygon) {
for (int n = 0; n < geometry.getNumGeometries(); n++) {
Geometry geometryN = geometry.getGeometryN(n);
if (geometryN.getBounds().intersects(bounds)) {
geometries.add(geometryN);
}
}
} else {
if (geometry.getBounds().intersects(bounds)) {