use of org.geotools.feature.collection.AdaptorFeatureCollection in project polymap4-core by Polymap4.
the class DataSourceProcessor method addFeaturesRequest.
@Override
public void addFeaturesRequest(AddFeaturesRequest request, ProcessorContext context) throws Exception {
Collection<Feature> features = request.getFeatures();
log.debug("addFeatures(): Features: " + features.size());
FeatureCollection fc = new AdaptorFeatureCollection("features", (SimpleFeatureType) fs.getSchema()) {
@Override
protected void closeIterator(Iterator it) {
}
@Override
protected Iterator openIterator() {
return features.iterator();
}
@Override
public int size() {
return features.size();
}
};
List<FeatureId> result = ((FeatureStore) fs).addFeatures(fc);
context.sendResponse(new ModifyFeaturesResponse(new FidSet(result)));
context.sendResponse(ProcessorResponse.EOP);
}
Aggregations