filter = createBBoxFilters(schema, attributes, aoi);
// now build the query using only the attributes and the bounding
// box needed
DefaultQuery q = new DefaultQuery(schema.getTypeName());
q.setFilter(filter);
q.setPropertyNames(attributes);
// now, if a definition query has been established for this layer, be
// sure to respect it by combining it with the bounding box one.
Query definitionQuery = layer.getQuery();
if (definitionQuery != Query.ALL) {
if (q == Query.ALL) {
q = (DefaultQuery) definitionQuery;
} else {
q = (DefaultQuery) DataUtilities.mixQueries(definitionQuery, q, "KMLEncoder");
}
}
q.setCoordinateSystem(layer.getFeatureSource().getSchema().getCoordinateReferenceSystem());
FeatureCollection<SimpleFeatureType, SimpleFeature> fc = fSource.getFeatures(q);
// decide wheter to render vector or raster based on kmscore
int kmscore = mapContext.getRequest().getWMS().getKmScore();