GEOS 3.13.1
geos::algorithm::PointLocator Class Reference

Computes the topological relationship (Location) of a single point to a Geometry. More...

#include <PointLocator.h>

Public Member Functions

geom::Location locate (const geom::CoordinateXY &p, const geom::Geometry *geom)
bool intersects (const geom::CoordinateXY &p, const geom::Geometry *geom)

Detailed Description

Computes the topological relationship (Location) of a single point to a Geometry.

The algorithm obeys the SFS boundaryDetermination rule to correctly determine whether the point lies on the boundary or not.

Notes:

  • instances of this class are not reentrant.
  • LinearRing objects do not enclose any area (points inside the ring are still in the EXTERIOR of the ring.)

Member Function Documentation

◆ intersects()

bool geos::algorithm::PointLocator::intersects ( const geom::CoordinateXY & p,
const geom::Geometry * geom )
inline

Convenience method to test a point for intersection with a Geometry

Parameters
pthe coordinate to test
geomthe Geometry to test
Returns
true if the point is in the interior or boundary of the Geometry

References geos::geom::EXTERIOR, and locate().

◆ locate()

geom::Location geos::algorithm::PointLocator::locate ( const geom::CoordinateXY & p,
const geom::Geometry * geom )

Computes the topological relationship (Location) of a single point to a Geometry. It handles both single-element and multi-element Geometries. The algorithm for multi-part Geometriestakes into account the SFS Boundary Determination rule.

Returns
the Location of the point relative to the input Geometry

Referenced by intersects().


The documentation for this class was generated from the following file: