- 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 611 of file measures.c.
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().
616 LWDEBUG(2,
"lw_dist2d_point_poly called");
622 LWDEBUG(3,
"looking for maxdistance");
628 LWDEBUG(3,
"first point not inside outer-ring");
638 for ( i = 1; i < poly->
nrings; i++)
648 LWDEBUG(3,
" inside the polygon");
#define LWDEBUG(level, msg)
const POINT2D * getPoint2d_cp(const POINTARRAY *pa, int n)
Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, suitable for reading from...
#define LW_TRUE
Return types for functions with status returns.
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...
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...