PostGIS  2.3.8dev-r@@SVN_REVISION@@

◆ ptarray_npoints_in_rect()

int ptarray_npoints_in_rect ( const POINTARRAY pa,
const GBOX gbox 
)

Definition at line 1882 of file ptarray.c.

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

1883 {
1884  const POINT2D *pt;
1885  int n = 0;
1886  int i;
1887  for ( i = 0; i < pa->npoints; i++ )
1888  {
1889  pt = getPoint2d_cp(pa, i);
1890  if ( gbox_contains_point2d(gbox, pt) )
1891  n++;
1892  }
1893  return n;
1894 }
int npoints
Definition: liblwgeom.h:370
const POINT2D * getPoint2d_cp(const POINTARRAY *pa, int n)
Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, suitable for reading from...
Definition: lwgeom_api.c:485
int gbox_contains_point2d(const GBOX *g, const POINT2D *p)
Definition: g_box.c:362
Here is the call graph for this function: