Class IndexedFeatureCollection
- java.lang.Object
-
- org.locationtech.jts.jump.feature.FeatureCollectionWrapper
-
- org.locationtech.jts.jump.feature.IndexedFeatureCollection
-
- All Implemented Interfaces:
FeatureCollection
public class IndexedFeatureCollection extends FeatureCollectionWrapper
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
Constructors Constructor Description IndexedFeatureCollection(FeatureCollection fc)
Constructs 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(Feature feature)
Adds a feature to this collection.void
addAll(Collection features)
Adds multiple features to this collection.List
query(org.locationtech.jts.geom.Envelope env)
A quick search for features, using an envelope comparison.Collection
remove(org.locationtech.jts.geom.Envelope env)
Removes the features which intersect the given envelopevoid
remove(Feature feature)
Removes a feature from this collection.void
removeAll(Collection features)
Removes multiple features from this collection.-
Methods inherited from class org.locationtech.jts.jump.feature.FeatureCollectionWrapper
checkNotWrappingSameClass, clear, getEnvelope, getFeatures, getFeatureSchema, getUltimateWrappee, getWrappee, hasWrapper, isEmpty, iterator, size
-
-
-
-
Constructor Detail
-
IndexedFeatureCollection
public IndexedFeatureCollection(FeatureCollection fc)
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 Detail
-
add
public void add(Feature feature)
Description copied from interface:FeatureCollection
Adds a feature to this collection.- Specified by:
add
in interfaceFeatureCollection
- Overrides:
add
in classFeatureCollectionWrapper
- Parameters:
feature
- a Feature to add to the end of this collection
-
remove
public void remove(Feature feature)
Description copied from interface:FeatureCollection
Removes a feature from this collection.- Specified by:
remove
in interfaceFeatureCollection
- Overrides:
remove
in classFeatureCollectionWrapper
- Parameters:
feature
- a Feature to remove from this collection
-
query
public List query(org.locationtech.jts.geom.Envelope env)
Description copied from interface:FeatureCollection
A quick search for features, using an envelope comparison.- Specified by:
query
in interfaceFeatureCollection
- Overrides:
query
in classFeatureCollectionWrapper
- Parameters:
env
- the envelope to query against- Returns:
- features whose envelopes intersect the given envelope
-
addAll
public void addAll(Collection features)
Description copied from interface:FeatureCollection
Adds 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:
addAll
in interfaceFeatureCollection
- Overrides:
addAll
in classFeatureCollectionWrapper
-
remove
public Collection remove(org.locationtech.jts.geom.Envelope env)
Description copied from interface:FeatureCollection
Removes the features which intersect the given envelope- Specified by:
remove
in interfaceFeatureCollection
- Overrides:
remove
in classFeatureCollectionWrapper
- Returns:
- the removed features
-
removeAll
public void removeAll(Collection features)
Description copied from interface:FeatureCollection
Removes 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:
removeAll
in interfaceFeatureCollection
- Overrides:
removeAll
in classFeatureCollectionWrapper
-
-