PostGIS  2.5.0dev-r@@SVN_REVISION@@

◆ ptarray_npoints_in_rect()

int ptarray_npoints_in_rect ( const POINTARRAY pa,
const GBOX gbox 
)

Definition at line 2077 of file ptarray.c.

References gbox_contains_point2d(), getPoint2d_cp(), and POINTARRAY::npoints.

2078 {
2079  const POINT2D *pt;
2080  int n = 0;
2081  uint32_t i;
2082  for ( i = 0; i < pa->npoints; i++ )
2083  {
2084  pt = getPoint2d_cp(pa, i);
2085  if ( gbox_contains_point2d(gbox, pt) )
2086  n++;
2087  }
2088  return n;
2089 }
unsigned int uint32_t
Definition: uthash.h:78
int gbox_contains_point2d(const GBOX *g, const POINT2D *p)
Definition: g_box.c:357
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: