if (collection == null) {
throw new NullPointerException("No content provided");
}
if (collection instanceof ListFeatureCollection) {
ListFeatureCollection list = (ListFeatureCollection) collection;
CollectionFeatureSource source = new CollectionFeatureSource(list);
return source;
}
if (collection instanceof SpatialIndexFeatureCollection) {
SpatialIndexFeatureCollection indexed = (SpatialIndexFeatureCollection) collection;
SpatialIndexFeatureSource source = new SpatialIndexFeatureSource(indexed);
return source;
}
if (collection instanceof TreeSetFeatureCollection) {
TreeSetFeatureCollection tree = (TreeSetFeatureCollection) collection;
CollectionFeatureSource source = new CollectionFeatureSource(tree);
return source;
}
// if( collection instanceof SimpleFeatureCollection ){
// SimpleFeatureCollection simpleFeatureCollection = simple( collection );