// wrap as a feature collection and return
final SimpleFeatureType schema = CoverageUtilities
.createFeatureType(gc2d, LineString.class);
final SimpleFeatureBuilder builder = new SimpleFeatureBuilder(schema);
int i = 0;
final ListFeatureCollection featureCollection = new ListFeatureCollection(schema);
final AffineTransformation jtsTransformation = new AffineTransformation(mt2D.getScaleX(),
mt2D.getShearX(), mt2D.getTranslateX(), mt2D.getShearY(), mt2D.getScaleY(),
mt2D.getTranslateY());
for (LineString line : prop) {
// get value
Double value = (Double) line.getUserData();
line.setUserData(null);
// filter coordinates in place
line.apply(jtsTransformation);
// create feature and add to list
builder.set("the_geom", line);
builder.set("value", value);
featureCollection.add(builder.buildFeature(String.valueOf(i++)));
}
// return value