PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ point_in_polygon_rtree()

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

Definition at line 895 of file lwgeom_functions_analytic.c.

896 {
897  int i;
898  POINT2D pt;
899 
900  POSTGIS_DEBUGF(2, "point_in_polygon called for %p %d %p.", root, ringCount, point);
901 
902  getPoint2d_p(point->point, 0, &pt);
903  /* assume bbox short-circuit has already been attempted */
904 
905  if (point_in_ring_rtree(root[0], &pt) != 1)
906  {
907  POSTGIS_DEBUG(3, "point_in_polygon_rtree: outside exterior ring.");
908 
909  return 0;
910  }
911 
912  for (i=1; i<ringCount; i++)
913  {
914  if (point_in_ring_rtree(root[i], &pt) != -1)
915  {
916  POSTGIS_DEBUGF(3, "point_in_polygon_rtree: within hole %d.", i);
917 
918  return 0;
919  }
920  }
921  return 1;
922 }
int getPoint2d_p(const POINTARRAY *pa, uint32_t n, POINT2D *point)
Definition: lwgeom_api.c:349
static int point_in_ring_rtree(RTREE_NODE *root, const POINT2D *point)
POINTARRAY * point
Definition: liblwgeom.h:457

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

Here is the call graph for this function: