Class RectangleIntersects



  • public class RectangleIntersects
    extends Object
    Optimized implementation of spatial predicate "intersects" for cases where the first Geometry is a rectangle.

    As a further optimization, this class can be used directly to test many geometries against a single rectangle.

    • Field Detail

      • MAXIMUM_SCAN_SEGMENT_COUNT

        public static final int MAXIMUM_SCAN_SEGMENT_COUNT
        Crossover size at which brute-force intersection scanning is slower than indexed intersection detection. Must be determined empirically. Should err on the safe side by making value smaller rather than larger.
        See Also:
        Constant Field Values
    • Constructor Detail

      • RectangleIntersects

        public RectangleIntersects(Polygon rectangle)
        Create a new intersects computer for a rectangle.
        Parameters:
        rectangle - a rectangular geometry
    • Method Detail

      • intersects

        public static boolean intersects(Polygon rectangle,
                                         Geometry b)
      • intersects

        public boolean intersects(Geometry geom)