Class 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 Detail

      • PlanitJtsItemVisitor

        public PlanitJtsItemVisitor​(org.locationtech.jts.geom.Polygon geometryFilter,
                                    Collection<T> filteredResultToPopulate)
        Constructor
        Parameters:
        geometryFilter - to use
        filteredResultToPopulate - 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 interface org.locationtech.jts.index.ItemVisitor
      • getResult

        public Collection<T> getResult()
        Collect the filtered result created by the visitor
        Returns:
        populated container