PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ point_in_polygon_rtree()

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

Definition at line 855 of file lwgeom_functions_analytic.c.

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

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

Here is the call graph for this function: