Filter fullFilter = (org.opengis.filter.Filter) parseResult;
final FilterFactory2 filterFactory2 = CommonFactoryFinder
.getFilterFactory2(GeoTools.getDefaultHints());
// -- extract spatial terms from Filter expression
FilterVisitor visitor = new GeomExtractor(filterFactory2);
Filter trimmedFilter = (Filter) fullFilter.accept(visitor, null);
if (trimmedFilter == null) {
return null;
}