PostGIS  2.5.0dev-r@@SVN_REVISION@@

◆ lwpoly_covers_pointarray()

int lwpoly_covers_pointarray ( const LWPOLY lwpoly,
const POINTARRAY pta 
)

return LW_TRUE if all points are inside the polygon

Definition at line 2609 of file lwgeodetic.c.

References getPoint2d_cp(), LW_FALSE, LW_TRUE, LWDEBUG, lwpoly_covers_point2d(), and POINTARRAY::npoints.

Referenced by lwpoly_covers_lwline(), and lwpoly_covers_lwpoly().

2610 {
2611  uint32_t i;
2612  for (i = 0; i < pta->npoints; i++) {
2613  const POINT2D* pt_to_test = getPoint2d_cp(pta, i);
2614 
2615  if ( LW_FALSE == lwpoly_covers_point2d(lwpoly, pt_to_test) ) {
2616  LWDEBUG(4,"returning false, geometry2 has point outside of geometry1");
2617  return LW_FALSE;
2618  }
2619  }
2620 
2621  return LW_TRUE;
2622 }
#define LWDEBUG(level, msg)
Definition: lwgeom_log.h:83
unsigned int uint32_t
Definition: uthash.h:78
#define LW_FALSE
Definition: liblwgeom.h:76
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:75
int lwpoly_covers_point2d(const LWPOLY *poly, const POINT2D *pt_to_test)
Given a polygon (lon/lat decimal degrees) and point (lon/lat decimal degrees) and a guaranteed outsid...
Definition: lwgeodetic.c:2431
const POINT2D * getPoint2d_cp(const POINTARRAY *pa, uint32_t n)
Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, suitable for reading from...
Definition: lwgeom_api.c:364
uint32_t npoints
Definition: liblwgeom.h:373
Here is the call graph for this function:
Here is the caller graph for this function: