PostGIS  2.5.0beta2dev-r@@SVN_REVISION@@

◆ point_in_polygon_rtree()

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

Definition at line 852 of file lwgeom_functions_analytic.c.

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

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