PostGIS  3.1.6dev-r@@SVN_REVISION@@

◆ pip_short_circuit()

static int pip_short_circuit ( RTREE_POLY_CACHE poly_cache,
LWPOINT point,
const GSERIALIZED gpoly 
)
static

Definition at line 142 of file postgis/lwgeom_geos.c.

143 {
144  int result;
145  if ( poly_cache && poly_cache->ringIndices )
146  {
147  result = point_in_multipolygon_rtree(poly_cache->ringIndices, poly_cache->polyCount, poly_cache->ringCounts, point);
148  }
149  else
150  {
151  LWGEOM* poly = lwgeom_from_gserialized(gpoly);
152  if ( lwgeom_get_type(poly) == POLYGONTYPE )
153  {
154  result = point_in_polygon(lwgeom_as_lwpoly(poly), point);
155  }
156  else
157  {
159  }
160  lwgeom_free(poly);
161  }
162 
163  return result;
164 }
char result[OUT_DOUBLE_BUFFER_SIZE]
Definition: cu_print.c:267
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
Definition: gserialized.c:239
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1138
LWMPOLY * lwgeom_as_lwmpoly(const LWGEOM *lwgeom)
Definition: lwgeom.c:243
#define POLYGONTYPE
Definition: liblwgeom.h:118
LWPOLY * lwgeom_as_lwpoly(const LWGEOM *lwgeom)
Definition: lwgeom.c:198
int point_in_multipolygon(LWMPOLY *mpolygon, LWPOINT *point)
int point_in_multipolygon_rtree(RTREE_NODE **root, int polyCount, int *ringCounts, LWPOINT *point)
int point_in_polygon(LWPOLY *polygon, LWPOINT *point)
static uint32_t lwgeom_get_type(const LWGEOM *geom)
Return LWTYPE number.
Definition: lwinline.h:145
RTREE_NODE ** ringIndices
Definition: lwgeom_rtree.h:60

References lwgeom_as_lwmpoly(), lwgeom_as_lwpoly(), lwgeom_free(), lwgeom_from_gserialized(), lwgeom_get_type(), point_in_multipolygon(), point_in_multipolygon_rtree(), point_in_polygon(), RTREE_POLY_CACHE::polyCount, POLYGONTYPE, result, RTREE_POLY_CACHE::ringCounts, and RTREE_POLY_CACHE::ringIndices.

Referenced by contains(), coveredby(), covers(), and ST_Intersects().

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