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

Definition at line 1083 of file lwgeom_functions_analytic.c.

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

1084 {
1085  int i;
1086  POINT2D pt;
1087 
1088  POSTGIS_DEBUGF(2, "point_in_polygon called for %p %d %p.", root, ringCount, point);
1089 
1090  getPoint2d_p(point->point, 0, &pt);
1091  /* assume bbox short-circuit has already been attempted */
1092 
1093  if (point_in_ring_rtree(root[0], &pt) != 1)
1094  {
1095  POSTGIS_DEBUG(3, "point_in_polygon_rtree: outside exterior ring.");
1096 
1097  return 0;
1098  }
1099 
1100  for (i=1; i<ringCount; i++)
1101  {
1102  if (point_in_ring_rtree(root[i], &pt) != -1)
1103  {
1104  POSTGIS_DEBUGF(3, "point_in_polygon_rtree: within hole %d.", i);
1105 
1106  return 0;
1107  }
1108  }
1109  return 1;
1110 }
POINTARRAY * point
Definition: liblwgeom.h:367
int getPoint2d_p(const POINTARRAY *pa, int n, POINT2D *point)
Definition: lwgeom_api.c:434
int point_in_ring_rtree(RTREE_NODE *root, POINT2D *point)

Here is the call graph for this function: