GEOS  3.9.1dev
Public Member Functions | Static Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
geos::algorithm::locate::SimplePointInAreaLocator Class Reference

Computes the location of points relative to a polygonal Geometry, using a simple O(n) algorithm. More...

#include <SimplePointInAreaLocator.h>

Inheritance diagram for geos::algorithm::locate::SimplePointInAreaLocator:
[legend]
Collaboration diagram for geos::algorithm::locate::SimplePointInAreaLocator:
[legend]

Public Member Functions

 SimplePointInAreaLocator (const geom::Geometry *p_g)
 
geom::Location locate (const geom::Coordinate *p) override
 
- Public Member Functions inherited from geos::algorithm::locate::PointOnGeometryLocator
virtual ~PointOnGeometryLocator ()
 

Static Public Member Functions

static geom::Location locate (const geom::Coordinate &p, const geom::Geometry *geom)
 
static geom::Location locatePointInPolygon (const geom::Coordinate &p, const geom::Polygon *poly)
 Determines the Location of a point in a Polygon. More...
 
static bool isContained (const geom::Coordinate &p, const geom::Geometry *geom)
 Determines whether a point is contained in a Geometry, or lies on its boundary. More...
 

Static Private Member Functions

static geom::Location locateInGeometry (const geom::Coordinate &p, const geom::Geometry *geom)
 

Private Attributes

const geom::Geometryg
 

Detailed Description

Computes the location of points relative to a polygonal Geometry, using a simple O(n) algorithm.

The algorithm used reports if a point lies in the interior, exterior, or exactly on the boundary of the Geometry.

Instance methods are provided to implement the interface PointInAreaLocator. However, they provide no performance advantage over the class methods.

This algorithm is suitable for use in cases where only a few points will be tested. If many points will be tested, IndexedPointInAreaLocator may provide better performance.

Definition at line 47 of file SimplePointInAreaLocator.h.

Constructor & Destructor Documentation

geos::algorithm::locate::SimplePointInAreaLocator::SimplePointInAreaLocator ( const geom::Geometry p_g)
inline

Definition at line 91 of file SimplePointInAreaLocator.h.

Member Function Documentation

static bool geos::algorithm::locate::SimplePointInAreaLocator::isContained ( const geom::Coordinate p,
const geom::Geometry geom 
)
static

Determines whether a point is contained in a Geometry, or lies on its boundary.

This is a convenience method for

 Location::EXTERIOR != locate(p, geom)
Parameters
pthe point to test
geomthe geometry to test
Returns
true if the point lies in or on the geometry
static geom::Location geos::algorithm::locate::SimplePointInAreaLocator::locate ( const geom::Coordinate p,
const geom::Geometry geom 
)
static
geom::Location geos::algorithm::locate::SimplePointInAreaLocator::locate ( const geom::Coordinate p)
inlineoverridevirtual

Determines the Location of a point in an areal Geometry.

Parameters
pthe point to test
Returns
the location of the point in the geometry

Implements geos::algorithm::locate::PointOnGeometryLocator.

Definition at line 96 of file SimplePointInAreaLocator.h.

static geom::Location geos::algorithm::locate::SimplePointInAreaLocator::locateInGeometry ( const geom::Coordinate p,
const geom::Geometry geom 
)
staticprivate
static geom::Location geos::algorithm::locate::SimplePointInAreaLocator::locatePointInPolygon ( const geom::Coordinate p,
const geom::Polygon poly 
)
static

Determines the Location of a point in a Polygon.

The return value is one of:

Computes geom::Location::BOUNDARY if the point lies exactly on the polygon boundary.

Parameters
pthe point to test
polythe geometry to test
Returns
the Location of the point in the polygon

Member Data Documentation

const geom::Geometry* geos::algorithm::locate::SimplePointInAreaLocator::g
private

Definition at line 106 of file SimplePointInAreaLocator.h.


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