PostGIS  3.7.0dev-r@@SVN_REVISION@@

◆ itree_pip_intersects()

bool itree_pip_intersects ( const IntervalTree itree,
const LWGEOM lwpoints 
)

Definition at line 217 of file lwgeom_itree.c.

218 {
219  if (lwgeom_get_type(lwpoints) == POINTTYPE)
220  {
221  return itree_point_in_multipolygon(itree, lwgeom_as_lwpoint(lwpoints)) != ITREE_OUTSIDE;
222  }
223  else if (lwgeom_get_type(lwpoints) == MULTIPOINTTYPE)
224  {
225  LWMPOINT* mpoint = lwgeom_as_lwmpoint(lwpoints);
226  for (uint32_t i = 0; i < mpoint->ngeoms; i++)
227  {
228  const LWPOINT *pt = mpoint->geoms[i];
229 
230  if (lwpoint_is_empty(pt))
231  continue;
232 
233  if (itree_point_in_multipolygon(itree, pt) != ITREE_OUTSIDE)
234  return true;
235  }
236  return false;
237  }
238  else
239  {
240  elog(ERROR, "%s got a non-point input", __func__);
241  return false;
242  }
243 }
IntervalTreeResult itree_point_in_multipolygon(const IntervalTree *itree, const LWPOINT *point)
Definition: intervaltree.c:461
@ ITREE_OUTSIDE
Definition: intervaltree.h:35
LWMPOINT * lwgeom_as_lwmpoint(const LWGEOM *lwgeom)
Definition: lwgeom.c:242
#define MULTIPOINTTYPE
Definition: liblwgeom.h:105
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:102
int lwpoint_is_empty(const LWPOINT *point)
static uint32_t lwgeom_get_type(const LWGEOM *geom)
Return LWTYPE number.
Definition: lwinline.h:141
static LWPOINT * lwgeom_as_lwpoint(const LWGEOM *lwgeom)
Definition: lwinline.h:127
uint32_t ngeoms
Definition: liblwgeom.h:538
LWPOINT ** geoms
Definition: liblwgeom.h:533

References LWMPOINT::geoms, ITREE_OUTSIDE, itree_point_in_multipolygon(), lwgeom_as_lwmpoint(), lwgeom_as_lwpoint(), lwgeom_get_type(), lwpoint_is_empty(), MULTIPOINTTYPE, LWMPOINT::ngeoms, and POINTTYPE.

Referenced by ST_Intersects().

Here is the call graph for this function:
Here is the caller graph for this function: