Package org.geotools.wfs
Class CompositeFeatureCollection
- Object
-
- DataFeatureCollection
-
- CompositeFeatureCollection
-
- All Implemented Interfaces:
SimpleFeatureCollection
,FeatureCollection<SimpleFeatureType,SimpleFeature>
public class CompositeFeatureCollection extends DataFeatureCollection
Wraps multiple feature collections into a single.This feature collection is used for wfs feature collections which can be made up of features from different schemas.
- Author:
- Justin Deoliveira, The Open Planning Project
-
-
Field Summary
-
Fields inherited from class DataFeatureCollection
id, listeners, schema
-
-
Constructor Summary
Constructors Constructor Description CompositeFeatureCollection(List<FeatureCollection> collections)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addAll(Collection arg0)
Optimized implementation of addAll that recognizes the use of collections obtained with subCollection( filter ).ReferencedEnvelope
getBounds()
Get the total bounds of this collection which is calculated by doing a union of the bounds of each feature inside of itint
getCount()
FeatureId
getIdentifier()
SimpleFeatureType
getSchema()
The schema for the child feature members of this collection.protected Iterator<SimpleFeature>
openIterator()
Returns a FeatureWriterIterator, or FeatureReaderIterator over content.<T> T[]
toArray(T[] arg0)
-
Methods inherited from class DataFeatureCollection
accepts, add, addAll, addListener, clear, close, close, closeIterator, contains, containsAll, features, fireChange, fireChange, fireChange, getID, isEmpty, iterator, purge, reader, remove, removeAll, removeListener, retainAll, size, sort, subCollection, toArray, writer
-
-
-
-
Constructor Detail
-
CompositeFeatureCollection
public CompositeFeatureCollection(List<FeatureCollection> collections)
-
-
Method Detail
-
openIterator
protected Iterator<SimpleFeature> openIterator() throws IOException
Description copied from class:DataFeatureCollection
Returns a FeatureWriterIterator, or FeatureReaderIterator over content.If you have a way to tell that you are readonly please subclass with a less hardcore check - this implementations catches a UnsupportedOpperationsException from wrtier()!
- Overrides:
openIterator
in classDataFeatureCollection
- Returns:
- Iterator, should be closed closeIterator
- Throws:
IOException
-
getSchema
public SimpleFeatureType getSchema()
Description copied from interface:FeatureCollection
The schema for the child feature members of this collection.Represents the most general FeatureType in common to all the features in this collection.
- For a collection backed by a shapefiles (or database tables) the FeatureType returned by getSchema() will complete describe each and every child in the collection.
- For mixed content FeatureCollections you will need to check the FeatureType of each Feature as it is retrived from the collection
- The degenerate case returns the "_Feature" FeatureType, where the only thing known is that the contents are Features.
- Specified by:
getSchema
in interfaceFeatureCollection<SimpleFeatureType,SimpleFeature>
- Overrides:
getSchema
in classDataFeatureCollection
- Returns:
- FeatureType describing the "common" schema to all child features of this collection
-
getBounds
public ReferencedEnvelope getBounds()
Description copied from interface:FeatureCollection
Get the total bounds of this collection which is calculated by doing a union of the bounds of each feature inside of it- Specified by:
getBounds
in interfaceFeatureCollection<SimpleFeatureType,SimpleFeature>
- Specified by:
getBounds
in classDataFeatureCollection
- Returns:
- An Envelope containing the total bounds of this collection.
-
getCount
public int getCount() throws IOException
- Specified by:
getCount
in classDataFeatureCollection
- Throws:
IOException
-
addAll
public boolean addAll(Collection arg0)
Description copied from class:DataFeatureCollection
Optimized implementation of addAll that recognizes the use of collections obtained with subCollection( filter ).This method is constructed by either:
- Filter OR
- Removing an extact match of Filter AND
- Overrides:
addAll
in classDataFeatureCollection
-
toArray
public <T> T[] toArray(T[] arg0)
- Specified by:
toArray
in interfaceFeatureCollection<SimpleFeatureType,SimpleFeature>
- Overrides:
toArray
in classDataFeatureCollection
- See Also:
Collection.toArray(Object[])
-
getIdentifier
public FeatureId getIdentifier()
-
-