PostGIS  2.3.8dev-r@@SVN_REVISION@@

◆ point_in_polygon_rtree()

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

Definition at line 873 of file lwgeom_functions_analytic.c.

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

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