Class PreparedPoint

  • All Implemented Interfaces:
    PreparedGeometry

    public class PreparedPoint
    extends Object
    A prepared version for Puntal geometries.

    Instances of this class are thread-safe.

    Author:
    Martin Davis
    • Constructor Detail

      • PreparedPoint

        public PreparedPoint​(Puntal point)
    • Method Detail

      • intersects

        public boolean intersects​(Geometry g)
        Tests whether this point intersects a Geometry.

        The optimization here is that computing topology for the test geometry is avoided. This can be significant for large geometries.

        Specified by:
        intersects in interface PreparedGeometry
        Parameters:
        g - the Geometry to test
        Returns:
        true if this Geometry intersects the given Geometry
        See Also:
        Geometry.intersects(Geometry)
      • getRepresentativePoints

        public List getRepresentativePoints()
        Gets the list of representative points for this geometry. One vertex is included for every component of the geometry (i.e. including one for every ring of polygonal geometries). Do not modify the returned list!
        Returns:
        a List of Coordinate
      • isAnyTargetComponentInTest

        public boolean isAnyTargetComponentInTest​(Geometry testGeom)
        Tests whether any representative of the target geometry intersects the test geometry. This is useful in A/A, A/L, A/P, L/P, and P/P cases.
        Parameters:
        testGeom - the test geometry
        Returns:
        true if any component intersects the areal test geometry
      • envelopesIntersect

        protected boolean envelopesIntersect​(Geometry g)
        Determines whether a Geometry g interacts with this geometry by testing the geometry envelopes.
        Parameters:
        g - a Geometry
        Returns:
        true if the envelopes intersect
      • envelopeCovers

        protected boolean envelopeCovers​(Geometry g)
        Determines whether the envelope of this geometry covers the Geometry g.
        Parameters:
        g - a Geometry
        Returns:
        true if g is contained in this envelope