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:

## Public Member Functions

| SimplePointInAreaLocator (const geom::Geometry *p_g)
| SimplePointInAreaLocator (const geom::Geometry &p_g)
geom::Location | locate (const geom::CoordinateXY *p) override

## Static Public Member Functions

static geom::Location | locate (const geom::CoordinateXY &p, const geom::Geometry *geom)
static geom::Location | locatePointInSurface (const geom::CoordinateXY &p, const geom::Surface &poly)
| Determines the Location of a point in a Surface.
static bool | isContained (const geom::CoordinateXY &p, const geom::Geometry *geom)
| Determines whether a point is contained in a Geometry, or lies on its boundary.

## 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.

## Member Function Documentation

## isContained()

bool geos::algorithm::locate::SimplePointInAreaLocator::isContained | ( | const geom::CoordinateXY & | 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

  p | the point to test
  geom | the geometry to test

Returns
  true if the point lies in or on the geometry

## locate()

geom::Location geos::algorithm::locate::SimplePointInAreaLocator::locate | ( | const geom::CoordinateXY * | p | ) |

inline override virtual

Determines the Location of a point in an areal Geometry.

Parameters

  p | the point to test

Returns
  the location of the point in the geometry

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

## locatePointInSurface()

geom::Location geos::algorithm::locate::SimplePointInAreaLocator::locatePointInSurface | ( | const geom::CoordinateXY & | p,
|  | const geom::Surface & | poly )

static

Determines the Location of a point in a Surface.

The return value is one of:

- geom::Location::INTERIOR if the point is in the geometry interior
- geom::Location::BOUNDARY if the point lies exactly on the boundary
- geom::Location::EXTERIOR if the point is outside the geometry

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

Parameters

  p | the point to test
  poly | the geometry to test

Returns
  the Location of the point in the polygon

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

- SimplePointInAreaLocator.h