private Filter createBBoxFilters(SimpleFeatureType schema, String[] attributes, Envelope bbox)
throws IllegalFilterException {
List filters = new ArrayList();
final int length = attributes.length;
for (int j = 0; j < length; j++) {
AttributeDescriptor ad = schema.getDescriptor(attributes[j]);
//DJB: added this for better error messages!
if (ad == null) {
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.fine(new StringBuffer("Could not find '").append(attributes[j])
.append("' in the FeatureType (")
.append(schema.getTypeName())
.append(")").toString());
}
throw new IllegalFilterException(new StringBuffer("Could not find '").append(attributes[j]
+ "' in the FeatureType (").append(schema.getTypeName()).append(")")
.toString());
}
if (ad instanceof GeometryDescriptor) {
Filter gfilter = filterFactory.bbox(ad.getLocalName(), bbox.getMinX(), bbox.getMinY(), bbox.getMaxX(), bbox.getMaxY(), null);
filters.add(gfilter);
}
}
if(filters.size() == 0)