// it's a transformation starting from vector data, let's see if we can optimize the query
FeatureCollection originalFeatures;
Query optimizedQuery = null;
if(transformation instanceof RenderingTransformation) {
RenderingTransformation tx = (RenderingTransformation) transformation;
optimizedQuery = tx.invertQuery(renderingQuery, gridGeometry);
}
// if we could not find an optimized query no other choice but to just limit
// ourselves to the bbox, we don't know if the transformation alters/adds attributes :-(
if(optimizedQuery == null) {
Envelope bounds = (Envelope) renderingQuery.getFilter().accept(ExtractBoundsFilterVisitor.BOUNDS_VISITOR, null);