Definition at line 722 of file lwgeom_functions_analytic.c.
References determineSide(), FP_CONTAINS_BOTTOM, LWMLINE::geoms, getPoint2d_cp(), isOnSegment(), LWMLINE::ngeoms, LWLINE::points, RTreeFindLineSegments(), POINT2D::x, and POINT2D::y.
Referenced by point_in_multipolygon_rtree(), and point_in_polygon_rtree().
731 POSTGIS_DEBUG(2,
"point_in_ring called.");
737 for (i=0; i<lines->
ngeoms; i++)
744 POSTGIS_DEBUGF(3,
"segment: (%.8f, %.8f),(%.8f, %.8f)", seg1->
x, seg1->
y, seg2->
x, seg2->
y);
745 POSTGIS_DEBUGF(3,
"side result: %.8f", side);
749 if (((seg2->
x - seg1->
x)*(seg2->
x - seg1->
x) + (seg2->
y - seg1->
y)*(seg2->
y - seg1->
y)) < 1e-12*1e-12)
751 POSTGIS_DEBUG(3,
"segment is zero length... ignoring.");
762 POSTGIS_DEBUGF(3,
"point on ring boundary between points %d, %d", i, i+1);
773 if ((seg1->
y <= point->
y) && (point->
y < seg2->
y) && (side > 0))
775 POSTGIS_DEBUG(3,
"incrementing winding number.");
784 else if ((seg2->
y <= point->
y) && (point->
y < seg1->
y) && (side < 0))
786 POSTGIS_DEBUG(3,
"decrementing winding number.");
792 POSTGIS_DEBUGF(3,
"winding number %d", wn);
LWMLINE * RTreeFindLineSegments(RTREE_NODE *root, double value)
Retrieves a collection of line segments given the root and crossing value.
const POINT2D * getPoint2d_cp(const POINTARRAY *pa, int n)
Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, suitable for reading from...
static int isOnSegment(const POINT2D *seg1, const POINT2D *seg2, const POINT2D *point)
static double determineSide(const POINT2D *seg1, const POINT2D *seg2, const POINT2D *point)
#define FP_CONTAINS_BOTTOM(A, X, B)