Class IndexedFeatureCollection
java.lang.Object
com.vividsolutions.jump.feature.FeatureCollectionWrapper
com.vividsolutions.jump.feature.IndexedFeatureCollection
- All Implemented Interfaces:
FeatureCollection, Iterable<Feature>
An IndexedFeatureCollection creates a new collection which is backed by a
FeatureCollection, but which is indexed for query purposes. In this
implementation, Features cannot be added or removed (an Exception is thrown)
and Features' Geometries should not be modified (otherwise they will be out
of sync with the spatial index).
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs an IndexedFeatureCollection wrapping the given FeatureCollection and using the default spatial index.IndexedFeatureCollection(FeatureCollection fc, org.locationtech.jts.index.SpatialIndex spatialIndex) Constructs an IndexedFeatureCollection wrapping the given FeatureCollection and using the given empty spatial index. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a feature to this collection.voidaddAll(Collection<Feature> features) Adds multiple features to this collection.query(org.locationtech.jts.geom.Envelope env) A quick search for features, using an envelope comparison.voidRemoves a feature from this collection.remove(org.locationtech.jts.geom.Envelope env) Removes the features which intersect the given envelopevoidremoveAll(Collection<Feature> features) Removes multiple features from this collection.Methods inherited from class FeatureCollectionWrapper
checkNotWrappingSameClass, clear, getEnvelope, getFeatureCollection, getFeatures, getFeatureSchema, getUltimateWrappee, getWrappee, getWrappee, hasWrapper, isEmpty, iterator, setFeatureCollection, sizeMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Iterable
forEach, spliterator
-
Constructor Details
-
IndexedFeatureCollection
Constructs an IndexedFeatureCollection wrapping the given FeatureCollection and using the default spatial index. -
IndexedFeatureCollection
public IndexedFeatureCollection(FeatureCollection fc, org.locationtech.jts.index.SpatialIndex spatialIndex) Constructs an IndexedFeatureCollection wrapping the given FeatureCollection and using the given empty spatial index.
-
-
Method Details
-
add
Description copied from interface:FeatureCollectionAdds a feature to this collection.- Specified by:
addin interfaceFeatureCollection- Overrides:
addin classFeatureCollectionWrapper- Parameters:
feature- a Feature to add to the end of this collection
-
remove
Description copied from interface:FeatureCollectionRemoves a feature from this collection.- Specified by:
removein interfaceFeatureCollection- Overrides:
removein classFeatureCollectionWrapper- Parameters:
feature- a Feature to remove from this collection
-
query
Description copied from interface:FeatureCollectionA quick search for features, using an envelope comparison.- Specified by:
queryin interfaceFeatureCollection- Overrides:
queryin classFeatureCollectionWrapper- Parameters:
env- the envelope to query against- Returns:
- features whose envelopes intersect the given envelope
-
addAll
Description copied from interface:FeatureCollectionAdds multiple features to this collection. To be preferred over #add for adding multiple features, because in some systems (like the JUMP Workbench) fewer events will be fired.- Specified by:
addAllin interfaceFeatureCollection- Overrides:
addAllin classFeatureCollectionWrapper
-
remove
Description copied from interface:FeatureCollectionRemoves the features which intersect the given envelope- Specified by:
removein interfaceFeatureCollection- Overrides:
removein classFeatureCollectionWrapper- Returns:
- the removed features
-
removeAll
Description copied from interface:FeatureCollectionRemoves multiple features from this collection. To be preferred over #remove for removing multiple features, because in some systems (like the JUMP Workbench) fewer events will be fired.- Specified by:
removeAllin interfaceFeatureCollection- Overrides:
removeAllin classFeatureCollectionWrapper
-