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

Definition at line 853 of file lwgeom_functions_analytic.c.

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

854 {
855  int i;
856  POINT2D pt;
857 
858  POSTGIS_DEBUGF(2, "point_in_polygon called for %p %d %p.", root, ringCount, point);
859 
860  getPoint2d_p(point->point, 0, &pt);
861  /* assume bbox short-circuit has already been attempted */
862 
863  if (point_in_ring_rtree(root[0], &pt) != 1)
864  {
865  POSTGIS_DEBUG(3, "point_in_polygon_rtree: outside exterior ring.");
866 
867  return 0;
868  }
869 
870  for (i=1; i<ringCount; i++)
871  {
872  if (point_in_ring_rtree(root[i], &pt) != -1)
873  {
874  POSTGIS_DEBUGF(3, "point_in_polygon_rtree: within hole %d.", i);
875 
876  return 0;
877  }
878  }
879  return 1;
880 }
POINTARRAY * point
Definition: liblwgeom.h:395
int getPoint2d_p(const POINTARRAY *pa, int n, POINT2D *point)
Definition: lwgeom_api.c:448
int point_in_ring_rtree(RTREE_NODE *root, POINT2D *point)

Here is the call graph for this function: