Definition at line 827 of file ptarray.c.
831 lwerror(
"%s called on invalid linestring", __func__);
833 int intersections = 0;
838 for (uint32_t i = 0; i < pa->
npoints-1; ++i)
862 if (((p1->
y <= py) && (py < p2->
y)) || ((p2->
y <= py) && (py < p1->
y)))
868 double x_intersection = p1->
x + (py - p1->
y) * (p2->
x - p1->
x) / (p2->
y - p1->
y);
874 if (x_intersection > px)
881 return intersections;
#define LW_TRUE
Return types for functions with status returns.
int lw_pt_on_segment(const POINT2D *p1, const POINT2D *p2, const POINT2D *p)
int p2d_same(const POINT2D *p1, const POINT2D *p2)
void void lwerror(const char *fmt,...) __attribute__((format(printf
Write a notice out to the error handler.
static const POINT2D * getPoint2d_cp(const POINTARRAY *pa, uint32_t n)
Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, suitable for reading from.
References getPoint2d_cp(), lw_pt_on_segment(), LW_TRUE, lwerror(), POINTARRAY::npoints, p2d_same(), POINT2D::x, POINT2D::y, and pixval::y.
Referenced by lwcompound_contains_point().