PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ point_in_polygon_rtree()

int point_in_polygon_rtree ( RTREE_NODE **  root,
int  ringCount,
LWPOINT point 
)

Definition at line 882 of file lwgeom_functions_analytic.c.

References getPoint2d_p(), LWPOINT::point, and point_in_ring_rtree().

883 {
884  int i;
885  POINT2D pt;
886 
887  POSTGIS_DEBUGF(2, "point_in_polygon called for %p %d %p.", root, ringCount, point);
888 
889  getPoint2d_p(point->point, 0, &pt);
890  /* assume bbox short-circuit has already been attempted */
891 
892  if (point_in_ring_rtree(root[0], &pt) != 1)
893  {
894  POSTGIS_DEBUG(3, "point_in_polygon_rtree: outside exterior ring.");
895 
896  return 0;
897  }
898 
899  for (i=1; i<ringCount; i++)
900  {
901  if (point_in_ring_rtree(root[i], &pt) != -1)
902  {
903  POSTGIS_DEBUGF(3, "point_in_polygon_rtree: within hole %d.", i);
904 
905  return 0;
906  }
907  }
908  return 1;
909 }
static int point_in_ring_rtree(RTREE_NODE *root, const POINT2D *point)
POINTARRAY * point
Definition: liblwgeom.h:411
int getPoint2d_p(const POINTARRAY *pa, int n, POINT2D *point)
Definition: lwgeom_api.c:347
Here is the call graph for this function: