List<InternalFeature> features;
try {
features = vectorLayerService.getFeatures(layerId, null, filterService
.createFidFilter(new String[] { featureId }), null, getIncludes(noGeom));
} catch (GeomajasException e) {
throw new RestException(e, RestException.PROBLEM_READING_LAYERSERVICE, layerId);
}
if (features.size() != 1) {
throw new RestException(RestException.FEATURE_NOT_FOUND, featureId, layerId);
}
model.addAttribute(FEATURE_COLLECTION, features.get(0));
model.addAttribute(VECTOR_LAYER_INFO, features.get(0).getLayer().getLayerInfo());
model.addAttribute(ATTRIBUTES, attrs);
return VIEW;