Package org.goplanit.utils.geo
Class PlanitJtsItemVisitor<T>
- java.lang.Object
-
- org.goplanit.utils.geo.PlanitJtsItemVisitor<T>
-
- All Implemented Interfaces:
org.locationtech.jts.index.ItemVisitor
- Direct Known Subclasses:
PlanitJtsIntersectEdgeVisitor
,PlanitJtsIntersectZoneVisitor
public abstract class PlanitJtsItemVisitor<T> extends Object implements org.locationtech.jts.index.ItemVisitor
An item visitor for quadtree spatial index to filter out planit entities in a quadtree that truly intersect with the given bounding box provided in the query. Since spatial granularity of the "squares" in the quadtree might be too coarse it may select a too large a set of matches for any given bounding box. By providing this visitor we explicitly check the provided subset if it indeed intersects with the given filer, i.e., bounding box that we are searching for.- Author:
- markr
-
-
Constructor Summary
Constructors Constructor Description PlanitJtsItemVisitor(org.locationtech.jts.geom.Polygon geometryFilter, Collection<T> filteredResultToPopulate)
Constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract org.locationtech.jts.geom.Geometry
getGeometry(T planitEntity)
The implementing class is expected to provide the envelope for the entityCollection<T>
getResult()
Collect the filtered result created by the visitorvoid
visitItem(Object planitEntity)
-
-
-
Constructor Detail
-
PlanitJtsItemVisitor
public PlanitJtsItemVisitor(org.locationtech.jts.geom.Polygon geometryFilter, Collection<T> filteredResultToPopulate)
Constructor- Parameters:
geometryFilter
- to usefilteredResultToPopulate
- to populate
-
-
Method Detail
-
getGeometry
protected abstract org.locationtech.jts.geom.Geometry getGeometry(T planitEntity)
The implementing class is expected to provide the envelope for the entity- Parameters:
planitEntity
- to extract envelope for- Returns:
- envelope of the entity to match the filter
-
visitItem
public void visitItem(Object planitEntity)
- Specified by:
visitItem
in interfaceorg.locationtech.jts.index.ItemVisitor
-
getResult
public Collection<T> getResult()
Collect the filtered result created by the visitor- Returns:
- populated container
-
-