- see if pt in outer boundary. if no, then treat the outer ring like a line
- if in the boundary, test to see if its in a hole. if so, then return dist to hole, else return 0 (point in polygon)
Definition at line 615 of file measures.c.
620 LWDEBUG(2,
"lw_dist2d_point_poly called");
626 LWDEBUG(3,
"looking for maxdistance");
632 LWDEBUG(3,
"first point not inside outer-ring");
642 for ( i = 1; i < poly->
nrings; i++)
652 LWDEBUG(3,
" inside the polygon");
#define LW_TRUE
Return types for functions with status returns.
const POINT2D * getPoint2d_cp(const POINTARRAY *pa, uint32_t n)
Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, suitable for reading from.
int ptarray_contains_point(const POINTARRAY *pa, const POINT2D *pt)
Return 1 if the point is inside the POINTARRAY, -1 if it is outside, and 0 if it is on the boundary.
#define LWDEBUG(level, msg)
int lw_dist2d_pt_ptarray(const POINT2D *p, POINTARRAY *pa, DISTPTS *dl)
search all the segments of pointarray to see which one is closest to p1 Returns minimum distance betw...
References DIST_MAX, DIST_MIN, DISTPTS::distance, getPoint2d_cp(), lw_dist2d_pt_ptarray(), LW_OUTSIDE, LW_TRUE, LWDEBUG, DISTPTS::mode, LWPOLY::nrings, DISTPTS::p1, DISTPTS::p2, LWPOINT::point, ptarray_contains_point(), LWPOLY::rings, POINT2D::x, and POINT2D::y.
Referenced by lw_dist2d_distribute_bruteforce().