GEOS 3.14.0dev
Static Public Member Functions | List of all members
geos::algorithm::PointLocation Class Reference

Functions for locating points within basic geometric structures such as lines and rings. More...

#include <PointLocation.h>

Static Public Member Functions

static bool isOnSegment (const geom::CoordinateXY &p, const geom::CoordinateXY &p0, const geom::CoordinateXY &p1)
 Tests whether a point lies on a line segment.
 
static bool isOnLine (const geom::CoordinateXY &p, const geom::CoordinateSequence *line)
 Tests whether a point lies on the line defined by a CoordinateSequence.
 
static bool isInRing (const geom::CoordinateXY &p, const std::vector< const geom::Coordinate * > &ring)
 Tests whether a point lies inside or on a ring.
 
static bool isInRing (const geom::CoordinateXY &p, const geom::CoordinateSequence *ring)
 
static geom::Location locateInRing (const geom::CoordinateXY &p, const std::vector< const geom::Coordinate * > &ring)
 Determines whether a point lies in the interior, on the boundary, or in the exterior of a ring. The ring may be oriented in either direction.
 
static geom::Location locateInRing (const geom::CoordinateXY &p, const geom::CoordinateSequence &ring)
 
static geom::Location locateInRing (const geom::CoordinateXY &p, const geom::Curve &ring)
 

Detailed Description

Functions for locating points within basic geometric structures such as lines and rings.

Author
Martin Davis

Member Function Documentation

◆ isInRing()

static bool geos::algorithm::PointLocation::isInRing ( const geom::CoordinateXY &  p,
const std::vector< const geom::Coordinate * > &  ring 
)
static

Tests whether a point lies inside or on a ring.

The ring may be oriented in either direction. A point lying exactly on the ring boundary is considered to be inside the ring.

This method does not first check the point against the envelope of the ring.

Parameters
ppoint to check for ring inclusion
ringan array of coordinates representing the ring (which must have first point identical to last point)
Returns
true if p is inside ring
See also
RayCrossingCounter::locatePointInRing()

◆ isOnLine()

static bool geos::algorithm::PointLocation::isOnLine ( const geom::CoordinateXY &  p,
const geom::CoordinateSequence line 
)
static

Tests whether a point lies on the line defined by a CoordinateSequence.

Parameters
pthe point to test
linethe line coordinates
Returns
true if the point is a vertex of the line or lies in the interior of a line segment in the line

◆ isOnSegment()

static bool geos::algorithm::PointLocation::isOnSegment ( const geom::CoordinateXY &  p,
const geom::CoordinateXY &  p0,
const geom::CoordinateXY &  p1 
)
static

Tests whether a point lies on a line segment.

Parameters
pthe point to test
p0a point of the line segment
p1a point of the line segment
Returns
true if the point lies on the line segment

◆ locateInRing()

static geom::Location geos::algorithm::PointLocation::locateInRing ( const geom::CoordinateXY &  p,
const std::vector< const geom::Coordinate * > &  ring 
)
static

Determines whether a point lies in the interior, on the boundary, or in the exterior of a ring. The ring may be oriented in either direction.

This method does not first check the point against the envelope of the ring.

Parameters
ppoint to check for ring inclusion
ringan array of coordinates representing the ring (which must have first point identical to last point)
Returns
the Location of p relative to the ring

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