Definition at line 818 of file ptarray.c.
822 lwerror(
"%s called on invalid linestring", __func__);
824 int intersections = 0;
829 for (uint32_t i = 0; i < pa->
npoints-1; ++i)
853 if (((p1->
y <= py) && (py < p2->
y)) || ((p2->
y <= py) && (py < p1->
y)))
859 double x_intersection = p1->
x + (py - p1->
y) * (p2->
x - p1->
x) / (p2->
y - p1->
y);
865 if (x_intersection > px)
872 return intersections;
#define LW_TRUE
Return types for functions with status returns.
int lw_pt_on_segment(const POINT2D *A1, const POINT2D *A2, const POINT2D *P)
int p2d_same(const POINT2D *p1, const POINT2D *p2)
void lwerror(const char *fmt,...)
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().