PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ ptarray_npoints_in_rect()

int ptarray_npoints_in_rect ( const POINTARRAY pa,
const GBOX gbox 
)

Definition at line 1929 of file ptarray.c.

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

1930 {
1931  const POINT2D *pt;
1932  int n = 0;
1933  int i;
1934  for ( i = 0; i < pa->npoints; i++ )
1935  {
1936  pt = getPoint2d_cp(pa, i);
1937  if ( gbox_contains_point2d(gbox, pt) )
1938  n++;
1939  }
1940  return n;
1941 }
int npoints
Definition: liblwgeom.h:371
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:373
int gbox_contains_point2d(const GBOX *g, const POINT2D *p)
Definition: g_box.c:362
Here is the call graph for this function: