Class PreparedGeometryIndex
- java.lang.Object
-
- org.locationtech.jtsexample.technique.PreparedGeometryIndex
-
class PreparedGeometryIndex extends java.lang.Object
A spatial index which indexesPreparedGeometry
s created from a set ofGeometry
s. This can be used for efficient testing for intersection with a series of target geomtries.
-
-
Field Summary
Fields Modifier and Type Field Description private SpatialIndex
index
-
Constructor Summary
Constructors Constructor Description PreparedGeometryIndex()
Creates a new index
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
insert(java.util.Collection geoms)
Inserts a collection of Geometrys into the index.java.util.List
intersects(Geometry g)
Finds allPreparedGeometry
s which intersect a givenGeometry
java.util.List
query(Geometry g)
Finds allPreparedGeometry
s which might interact with a queryGeometry
.
-
-
-
Field Detail
-
index
private SpatialIndex index
-
-
Method Detail
-
insert
public void insert(java.util.Collection geoms)
Inserts a collection of Geometrys into the index.- Parameters:
geoms
- a collection of Geometrys to insert
-
query
public java.util.List query(Geometry g)
Finds allPreparedGeometry
s which might interact with a queryGeometry
.- Parameters:
g
- the geometry to query by- Returns:
- a list of candidate PreparedGeometrys
-
intersects
public java.util.List intersects(Geometry g)
Finds allPreparedGeometry
s which intersect a givenGeometry
- Parameters:
g
- the geometry to query by- Returns:
- a list of intersecting PreparedGeometrys
-
-