Class RectangleIntersects


  • public class RectangleIntersects
    extends java.lang.Object
    Implementation of the intersects spatial predicate optimized for the case where one Geometry is a rectangle. This class works for all input geometries, including GeometryCollections.

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

    Version:
    1.7
    • Constructor Summary

      Constructors 
      Constructor Description
      RectangleIntersects​(Polygon rectangle)
      Create a new intersects computer for a rectangle.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean intersects​(Geometry geom)
      Tests whether the given Geometry intersects the query rectangle.
      static boolean intersects​(Polygon rectangle, Geometry b)
      Tests whether a rectangle intersects a given geometry.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RectangleIntersects

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

      • intersects

        public static boolean intersects​(Polygon rectangle,
                                         Geometry b)
        Tests whether a rectangle intersects a given geometry.
        Parameters:
        rectangle - a rectangular Polygon
        b - a Geometry of any type
        Returns:
        true if the geometries intersect
      • intersects

        public boolean intersects​(Geometry geom)
        Tests whether the given Geometry intersects the query rectangle.
        Parameters:
        geom - the Geometry to test (may be of any type)
        Returns:
        true if the geometry intersects the query rectangle