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

Computes an approximate intersection of two line segments by taking the most central of the endpoints of the segments. More...

#include <CentralEndpointIntersector.h>

Collaboration diagram for geos::algorithm::CentralEndpointIntersector:
[legend]

Public Member Functions

 CentralEndpointIntersector (const geom::Coordinate &p00, const geom::Coordinate &p01, const geom::Coordinate &p10, const geom::Coordinate &p11)
 
const geom::CoordinategetIntersection () const
 

Static Public Member Functions

static const geom::CoordinategetIntersection (const geom::Coordinate &p00, const geom::Coordinate &p01, const geom::Coordinate &p10, const geom::Coordinate &p11)
 

Private Member Functions

void compute ()
 
geom::Coordinate findNearestPoint (const geom::Coordinate &p, const std::vector< geom::Coordinate > &pts) const
 

Static Private Member Functions

static geom::Coordinate average (const std::vector< geom::Coordinate > &pts)
 

Private Attributes

std::vector< geom::Coordinate_pts
 
geom::Coordinate _intPt
 

Detailed Description

Computes an approximate intersection of two line segments by taking the most central of the endpoints of the segments.

This is effective in cases where the segments are nearly parallel and should intersect at an endpoint. It is also a reasonable strategy for cases where the endpoint of one segment lies on or almost on the interior of another one. Taking the most central endpoint ensures that the computed intersection point lies in the envelope of the segments. Also, by always returning one of the input points, this should result in reducing segment fragmentation. Intended to be used as a last resort for computing ill-conditioned intersection situations which cause other methods to fail.

Author
Martin Davis
Version
1.8

Definition at line 62 of file CentralEndpointIntersector.h.

Constructor & Destructor Documentation

geos::algorithm::CentralEndpointIntersector::CentralEndpointIntersector ( const geom::Coordinate p00,
const geom::Coordinate p01,
const geom::Coordinate p10,
const geom::Coordinate p11 
)
inline

Definition at line 75 of file CentralEndpointIntersector.h.

Member Function Documentation

static geom::Coordinate geos::algorithm::CentralEndpointIntersector::average ( const std::vector< geom::Coordinate > &  pts)
inlinestaticprivate
void geos::algorithm::CentralEndpointIntersector::compute ( )
inlineprivate

Definition at line 105 of file CentralEndpointIntersector.h.

geom::Coordinate geos::algorithm::CentralEndpointIntersector::findNearestPoint ( const geom::Coordinate p,
const std::vector< geom::Coordinate > &  pts 
) const
inlineprivate

Determines a point closest to the given point.

Parameters
pthe point to compare against
p1a potential result point
p2a potential result point
q1a potential result point
q2a potential result point
Returns
the point closest to the input point p

Definition at line 140 of file CentralEndpointIntersector.h.

References geos::geom::Coordinate::distanceSquared(), and geos::geom::Coordinate::getNull().

Here is the call graph for this function:

static const geom::Coordinate& geos::algorithm::CentralEndpointIntersector::getIntersection ( const geom::Coordinate p00,
const geom::Coordinate p01,
const geom::Coordinate p10,
const geom::Coordinate p11 
)
inlinestatic

Definition at line 67 of file CentralEndpointIntersector.h.

References getIntersection().

Referenced by getIntersection().

Here is the call graph for this function:

Here is the caller graph for this function:

const geom::Coordinate& geos::algorithm::CentralEndpointIntersector::getIntersection ( ) const
inline

Definition at line 90 of file CentralEndpointIntersector.h.

Member Data Documentation

geom::Coordinate geos::algorithm::CentralEndpointIntersector::_intPt
private

Definition at line 102 of file CentralEndpointIntersector.h.

std::vector<geom::Coordinate> geos::algorithm::CentralEndpointIntersector::_pts
private

Definition at line 100 of file CentralEndpointIntersector.h.


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