Filter polygon = ff.equal(ff.function("geometryType", geom), ff.literal("Polygon"), false);
Filter multiPolygon = ff.equal(ff.function("geometryType", geom), ff.literal("MultiPolygon"), false);
Filter geomCheck = ff.or(Arrays.asList(polygon, multiPolygon));
Filter ruleFilter = copy.getFilter();
Filter filter = ruleFilter == null || ruleFilter == Filter.INCLUDE ? geomCheck : ff.and(geomCheck, ruleFilter);
RuleImpl extra = new RuleImpl(copy);
extra.setFilter(filter);
extra.symbolizers().clear();
extra.symbolizers().add(sb.createPolygonSymbolizer());
extraRules.add(extra);
}
}
}