- 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 651 of file measures.c.
669 for (uint32_t i = 1; i < poly->
nrings; i++)
#define LW_TRUE
Return types for functions with status returns.
int ptarray_contains_point(const POINTARRAY *pa, const POINT2D *pt)
The following is based on the "Fast Winding Number Inclusion of a Point in a Polygon" algorithm by Da...
static const POINT2D * getPoint2d_cp(const POINTARRAY *pa, uint32_t n)
Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, suitable for reading from.
static void lw_dist2d_distpts_set(DISTPTS *dl, double distance, const POINT2D *p1, const POINT2D *p2)
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, getPoint2d_cp(), lw_dist2d_distpts_set(), lw_dist2d_pt_ptarray(), LW_OUTSIDE, LW_TRUE, DISTPTS::mode, LWPOLY::nrings, LWPOINT::point, ptarray_contains_point(), and LWPOLY::rings.
Referenced by lw_dist2d_distribute_bruteforce().