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

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

#include <PointLocator.h>

Public Member Functions

 PointLocator ()
 
 ~PointLocator ()
 
geom::Location locate (const geom::Coordinate &p, const geom::Geometry *geom)
 
bool intersects (const geom::Coordinate &p, const geom::Geometry *geom)
 

Private Member Functions

void computeLocation (const geom::Coordinate &p, const geom::Geometry *geom)
 
void updateLocationInfo (geom::Location loc)
 
geom::Location locate (const geom::Coordinate &p, const geom::Point *pt)
 
geom::Location locate (const geom::Coordinate &p, const geom::LineString *l)
 
geom::Location locateInPolygonRing (const geom::Coordinate &p, const geom::LinearRing *ring)
 
geom::Location locate (const geom::Coordinate &p, const geom::Polygon *poly)
 

Private Attributes

bool isIn
 
int numBoundaries
 

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:

Definition at line 57 of file PointLocator.h.

Constructor & Destructor Documentation

geos::algorithm::PointLocator::PointLocator ( )
inline

Definition at line 59 of file PointLocator.h.

geos::algorithm::PointLocator::~PointLocator ( )
inline

Definition at line 60 of file PointLocator.h.

Member Function Documentation

void geos::algorithm::PointLocator::computeLocation ( const geom::Coordinate p,
const geom::Geometry geom 
)
private
bool geos::algorithm::PointLocator::intersects ( const geom::Coordinate 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

Definition at line 81 of file PointLocator.h.

References geos::geom::EXTERIOR.

geom::Location geos::algorithm::PointLocator::locate ( const geom::Coordinate 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
geom::Location geos::algorithm::PointLocator::locate ( const geom::Coordinate p,
const geom::Point pt 
)
private
geom::Location geos::algorithm::PointLocator::locate ( const geom::Coordinate p,
const geom::LineString l 
)
private
geom::Location geos::algorithm::PointLocator::locate ( const geom::Coordinate p,
const geom::Polygon poly 
)
private
geom::Location geos::algorithm::PointLocator::locateInPolygonRing ( const geom::Coordinate p,
const geom::LinearRing ring 
)
private
void geos::algorithm::PointLocator::updateLocationInfo ( geom::Location  loc)
private

Member Data Documentation

bool geos::algorithm::PointLocator::isIn
private

Definition at line 88 of file PointLocator.h.

int geos::algorithm::PointLocator::numBoundaries
private

Definition at line 90 of file PointLocator.h.


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