GeometryFilter bboxFilter = fFac.createGeometryFilter(FilterType.GEOMETRY_INTERSECTS);
bboxFilter.addLeftGeometry(fFac.createAttributeExpression(schema,
schema.getGeometryDescriptor().getName().getLocalPart()));
bboxFilter.addRightGeometry(bboxExpression);
Query bboxQuery = new DefaultQuery(schema.getTypeName(), bboxFilter);
Query definitionQuery = layer.getQuery();
DefaultQuery finalQuery = new DefaultQuery(DataUtilities.mixQueries(definitionQuery, bboxQuery, "svgEncoder"));
finalQuery.setHints(definitionQuery.getHints());
finalQuery.setSortBy(definitionQuery.getSortBy());
finalQuery.setStartIndex(definitionQuery.getStartIndex());
LOGGER.fine("obtaining FeatureReader for " + schema.getTypeName());
featureReader = fSource.getFeatures(finalQuery).features();
LOGGER.fine("got FeatureReader, now writing");