use of org.polymap.core.data.pipeline.Produces in project polymap4-core by Polymap4.
the class FeatureRenameProcessor method featuresResponse.
@Produces(GetFeaturesResponse.class)
public void featuresResponse(GetFeaturesResponse response, ProcessorContext context) throws Exception {
assert schema != null : "Target schema is not yet initialized. Call getSchema() first.";
SimpleFeatureBuilder builder = new SimpleFeatureBuilder((SimpleFeatureType) schema);
// log.debug( " received features: " + chunk.count() );
List<Feature> result = new ArrayList(response.count());
for (Feature feature : response) {
for (PropertyDescriptor prop : schema.getDescriptors()) {
Property featureProp = feature.getProperty(prop.getName());
// the feature may not contain the property if it was not requested
if (featureProp != null) {
builder.set(prop.getName(), featureProp.getValue());
}
}
result.add(builder.buildFeature(feature.getIdentifier().getID()));
}
// log.debug( " sending features: " + result.size() );
context.sendResponse(new GetFeaturesResponse(result));
}
Aggregations