120 |
if (amdm != null) { |
if (amdm != null) { |
121 |
Vector<String> visibleAttrNames = new Vector<String>(); |
Vector<String> visibleAttrNames = new Vector<String>(); |
122 |
|
|
123 |
// Add the column with the geometry (usually "the_geom") |
// Add the column with the geometry (usually "the_geom") always |
124 |
visibleAttrNames.add(schema.getGeometryDescriptor() |
visibleAttrNames.add(schema.getGeometryDescriptor() |
125 |
.getLocalName()); |
.getLocalName()); |
126 |
|
|
129 |
visibleAttrNames.add(a.getLocalName()); |
visibleAttrNames.add(a.getLocalName()); |
130 |
} |
} |
131 |
|
|
132 |
// for (AttributeDescriptor aDesc : |
// Tested with 2.6.x trunk from 2009-11-26 and it now works. So we only request the properties we need! |
133 |
// schema.getAttributeDescriptors()) { |
// /** |
134 |
// |
// * I got NPEs when properties contained only [the_geom] ?!??!!?? |
135 |
// // Always add the geometry |
// */ |
136 |
// if (schema.getGeometryDescriptor() |
// if (properties.length > 1) { |
|
// .getName().equals(aDesc.getName())) { |
|
|
// visibleAttrNames.add(schema.getGeometryDescriptor() |
|
|
// .getLocalName()); |
|
|
// continue; |
|
|
// } |
|
|
// |
|
|
// if (amd.get(aDesc.getName()).isVisible()) |
|
|
// visibleAttrNames.add(aDesc.getName().getLocalPart()); |
|
|
// } |
|
|
// |
|
|
// // create a query for the visible attributes |
|
|
String[] properties = visibleAttrNames.toArray(new String[] {}); |
|
|
// |
|
|
// LOGGER.debug("Query contains the following attributes: " |
|
|
// + visibleAttrNames); |
|
|
|
|
|
/** |
|
|
* I got NPEs when properties contained only [the_geom] ?!??!!?? |
|
|
* TODO Try again one day... Not today... 20.11.2009, SK |
|
|
*/ |
|
|
if (properties.length > 1) { |
|
137 |
query = new DefaultQuery(schema.getTypeName(), filter, |
query = new DefaultQuery(schema.getTypeName(), filter, |
138 |
properties); |
properties); |
139 |
} else { |
// } else { |
140 |
query = new DefaultQuery(schema.getTypeName(), filter); |
// query = new DefaultQuery(schema.getTypeName(), filter); |
141 |
} |
// } |
142 |
} |
} |
143 |
fc = fs.getFeatures(query); |
fc = fs.getFeatures(query); |
144 |
} |
} |