GEOS
3.9.1dev
|
Computes an approximate intersection of two line segments by taking the most central of the endpoints of the segments. More...
#include <CentralEndpointIntersector.h>
Public Member Functions | |
CentralEndpointIntersector (const geom::Coordinate &p00, const geom::Coordinate &p01, const geom::Coordinate &p10, const geom::Coordinate &p11) | |
const geom::Coordinate & | getIntersection () const |
Static Public Member Functions | |
static const geom::Coordinate & | getIntersection (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 |
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.
Definition at line 62 of file CentralEndpointIntersector.h.
|
inline |
Definition at line 75 of file CentralEndpointIntersector.h.
|
inlinestaticprivate |
Definition at line 112 of file CentralEndpointIntersector.h.
References geos::geom::Coordinate::x, and geos::geom::Coordinate::y.
|
inlineprivate |
Definition at line 105 of file CentralEndpointIntersector.h.
|
inlineprivate |
Determines a point closest to the given point.
p | the point to compare against |
p1 | a potential result point |
p2 | a potential result point |
q1 | a potential result point |
q2 | a potential result point |
Definition at line 140 of file CentralEndpointIntersector.h.
References geos::geom::Coordinate::distanceSquared(), and geos::geom::Coordinate::getNull().
|
inlinestatic |
Definition at line 67 of file CentralEndpointIntersector.h.
References getIntersection().
Referenced by getIntersection().
|
inline |
Definition at line 90 of file CentralEndpointIntersector.h.
|
private |
Definition at line 102 of file CentralEndpointIntersector.h.
|
private |
Definition at line 100 of file CentralEndpointIntersector.h.