PostGIS  2.5.0dev-r@@SVN_REVISION@@
int point_in_polygon_rtree ( RTREE_NODE **  root,
int  ringCount,
LWPOINT point 
)

Definition at line 810 of file lwgeom_functions_analytic.c.

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

811 {
812  int i;
813  POINT2D pt;
814 
815  POSTGIS_DEBUGF(2, "point_in_polygon called for %p %d %p.", root, ringCount, point);
816 
817  getPoint2d_p(point->point, 0, &pt);
818  /* assume bbox short-circuit has already been attempted */
819 
820  if (point_in_ring_rtree(root[0], &pt) != 1)
821  {
822  POSTGIS_DEBUG(3, "point_in_polygon_rtree: outside exterior ring.");
823 
824  return 0;
825  }
826 
827  for (i=1; i<ringCount; i++)
828  {
829  if (point_in_ring_rtree(root[i], &pt) != -1)
830  {
831  POSTGIS_DEBUGF(3, "point_in_polygon_rtree: within hole %d.", i);
832 
833  return 0;
834  }
835  }
836  return 1;
837 }
static int point_in_ring_rtree(RTREE_NODE *root, const POINT2D *point)
POINTARRAY * point
Definition: liblwgeom.h:410
int getPoint2d_p(const POINTARRAY *pa, uint32_t n, POINT2D *point)
Definition: lwgeom_api.c:338

Here is the call graph for this function: