if (sae.getDefaultGeometryUsed() && (!atts.contains(schema.getDefaultGeometry().getName()))) { atts.add(schema.getDefaultGeometry().getName());
/** * Inspects the <code>MapLayer</code>'s style and retrieves it's needed attribute names, * returning at least the default geometry attribute name. * * @param query DOCUMENT ME! * @param style the <code>Style</code> to determine the needed attributes from * @param schema the SimpleFeatureSource schema * @return the minimun set of attribute names needed to render <code>layer</code> */ private String[] findStyleAttributes( final Query query, Style style, SimpleFeatureType schema ) { StyleAttributeExtractor sae = new StyleAttributeExtractor(); sae.visit(style); FilterAttributeExtractor qae = new FilterAttributeExtractor(); query.getFilter().accept(qae,null); Set ftsAttributes = new LinkedHashSet(sae.getAttributeNameSet()); ftsAttributes.addAll(qae.getAttributeNameSet()); if (sae.getDefaultGeometryUsed() && (!ftsAttributes.contains(schema.getGeometryDescriptor().getLocalName()))) { ftsAttributes.add(schema.getGeometryDescriptor().getLocalName()); } else { // the code following assumes the geometry column is the last one // make sure it's the last for good ftsAttributes.remove(schema.getGeometryDescriptor().getLocalName()); ftsAttributes.add(schema.getGeometryDescriptor().getLocalName()); } return (String[]) ftsAttributes.toArray(new String[0]); }
if (sae.getDefaultGeometryUsed() && (!attributeNames.contains(schema.getGeometryDescriptor().getName().toString())) ) {