Class CollectionFeatureSource

  • All Implemented Interfaces:
    FeatureSource<SimpleFeatureType,​SimpleFeature>, SimpleFeatureSource

    public class CollectionFeatureSource
    extends Object
    implements SimpleFeatureSource
    This is a "port" of ContentFeatureSource to work with an iterator.

    To use this class please "wrap" CollectionFeatureSource around your choice of FeatureCollection.

     SimpleFeatureCollection collection = new ListFeatureCollection(schema);
     collection.add(feature1);
     collection.add(feature2);
     FeatureSource source = new CollectionFeatureSource(collection);
     

    Note to implementors: If you are performing "real I/O" please use ContentFeatureSource as it provides support for IOException.

    Author:
    Jody