int nLayers = layers.length;
// FeatureTypeInfo layerInfo = null;
int defMaxDecimals = writer.getMaximunFractionDigits();
FilterFactory fFac = FilterFactoryFinder.createFilterFactory();
for (int i = 0; i < nLayers; i++) {
MapLayer layer = layers[i];
SimpleFeatureIterator featureReader = null;
SimpleFeatureSource fSource;
fSource = (SimpleFeatureSource) layer.getFeatureSource();
SimpleFeatureType schema = fSource.getSchema();
try {
Expression bboxExpression = fFac.createBBoxExpression(mapContext
.getAreaOfInterest());
GeometryFilter bboxFilter = fFac
.createGeometryFilter(FilterType.GEOMETRY_INTERSECTS);
bboxFilter.addLeftGeometry(fFac.createAttributeExpression(schema, schema
.getGeometryDescriptor().getName().getLocalPart()));
bboxFilter.addRightGeometry(bboxExpression);
Query bboxQuery = new Query(schema.getTypeName(), bboxFilter);
Query definitionQuery = layer.getQuery();