PostGIS 3.6.2dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ lwpoly_contains_point()

int lwpoly_contains_point ( const LWPOLY poly,
const POINT2D pt 
)

Definition at line 532 of file lwpoly.c.

533{
534 uint32_t i;
535 int t;
536
537 if ( lwpoly_is_empty(poly) )
538 return LW_OUTSIDE;
539
540 t = ptarray_contains_point(poly->rings[0], pt);
541
542 if (t == LW_INSIDE)
543 {
544 for (i = 1; i < poly->nrings; i++)
545 {
546 t = ptarray_contains_point(poly->rings[i], pt);
547 if (t == LW_INSIDE)
548 return LW_OUTSIDE;
549 if (t == LW_BOUNDARY)
550 {
551 return LW_BOUNDARY;
552 }
553 }
554 return LW_INSIDE;
555 }
556 else
557 return t;
558}
#define LW_INSIDE
Constants for point-in-polygon return values.
#define LW_BOUNDARY
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...
Definition ptarray.c:755
int lwpoly_is_empty(const LWPOLY *poly)
#define LW_OUTSIDE
POINTARRAY ** rings
Definition liblwgeom.h:519
uint32_t nrings
Definition liblwgeom.h:524

References LW_BOUNDARY, LW_INSIDE, LW_OUTSIDE, lwpoly_is_empty(), LWPOLY::nrings, ptarray_contains_point(), and LWPOLY::rings.

Referenced by lwgeom_solid_contains_lwgeom().

Here is the call graph for this function:
Here is the caller graph for this function: