Class PreparedGeometryIndex
- java.lang.Object
-
- org.locationtech.jtsexample.technique.PreparedGeometryIndex
-
class PreparedGeometryIndex extends java.lang.ObjectA spatial index which indexesPreparedGeometrys created from a set ofGeometrys. This can be used for efficient testing for intersection with a series of target geomtries.
-
-
Field Summary
Fields Modifier and Type Field Description private SpatialIndexindex
-
Constructor Summary
Constructors Constructor Description PreparedGeometryIndex()Creates a new index
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidinsert(java.util.Collection geoms)Inserts a collection of Geometrys into the index.java.util.Listintersects(Geometry g)Finds allPreparedGeometrys which intersect a givenGeometryjava.util.Listquery(Geometry g)Finds allPreparedGeometrys 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 allPreparedGeometrys 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 allPreparedGeometrys which intersect a givenGeometry- Parameters:
g- the geometry to query by- Returns:
- a list of intersecting PreparedGeometrys
-
-