6550 const GBOX *minenv = NULL;
6552 const GBOX *testbox;
6553 GEOSGeometry *ghole;
6571 if ( ! shells->
tree )
6574 LWDEBUG(1,
"Building STRtree");
6576 if (shells->
tree == NULL)
6581 for (i=0; i<shells->
size; ++i)
6585 LWDEBUGF(2,
"GBOX of shell %p for edge %d is %g %g,%g %g",
6591 pt.
x = shellbox->
xmin;
6592 pt.
y = shellbox->
ymin;
6594 pt.
x = shellbox->
xmax;
6595 pt.
y = shellbox->
ymax;
6602 GEOSSTRtree_insert(shells->
tree, sring->
genv, sring);
6604 LWDEBUG(1,
"STRtree build completed");
6610 LWDEBUGF(1,
"Found %d candidate shells containing first point of ring's originating edge %d",
6615 for (i=0; i<candidates.
size; ++i)
6623 LWDEBUGF(1,
"Shell %d is on other side of ring",
6631 LWDEBUGF(1,
"Bbox of shell %d equals that of hole ring",
6639 LWDEBUGF(1,
"Bbox of shell %d does not contain bbox of ring point",
6648 LWDEBUGF(2,
"Bbox of shell %d (face %d) not contained by bbox "
6649 "of last shell found to contain the point",
6660 LWDEBUGF(1,
"Shell %d contains hole of edge %d",
6667 if ( foundInFace == -1 ) foundInFace = 0;
6669 candidates.
size = 0;
6672 GEOSGeom_destroy(ghole);
int gbox_same(const GBOX *g1, const GBOX *g2)
Check if 2 given Gbox are the same.
int gbox_contains_2d(const GBOX *g1, const GBOX *g2)
Return LW_TRUE if the first GBOX contains the second on the 2d plane, LW_FALSE otherwise.
char lwgeom_geos_errmsg[LWGEOM_GEOS_ERRMSG_MAXSIZE]
GEOSGeometry * LWGEOM2GEOS(const LWGEOM *lwgeom, uint8_t autofix)
LWPOINT * lwpoint_make2d(int srid, double x, double y)
LWGEOM * lwline_as_lwgeom(const LWLINE *obj)
void lwpoint_free(LWPOINT *pt)
int getPoint2d_p(const POINTARRAY *pa, uint32_t n, POINT2D *point)
POINTARRAY * ptarray_construct(char hasz, char hasm, uint32_t npoints)
Construct an empty pointarray, allocating storage and setting the npoints, but not filling in any inf...
LWGEOM * lwpoint_as_lwgeom(const LWPOINT *obj)
LWLINE * lwline_construct(int srid, GBOX *bbox, POINTARRAY *points)
void ptarray_set_point4d(POINTARRAY *pa, uint32_t n, const POINT4D *p4d)
void lwline_free(LWLINE *line)
LWT_INT64 LWT_ELEMID
Identifier of topology element.
static const int STRTREE_NODE_CAPACITY
#define LWDEBUG(level, msg)
#define LWDEBUGF(level, msg,...)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
static int _lwt_EdgeRingContainsPoint(LWT_EDGERING *ring, POINT2D *p)
static LWT_ELEMID _lwt_EdgeRingGetFace(LWT_EDGERING *ring)
static GBOX * _lwt_EdgeRingGetBbox(LWT_EDGERING *ring)
#define LWT_EDGERING_ARRAY_INIT(a)
static void _lwt_AccumulateCanditates(void *item, void *userdata)
#define LWT_EDGERING_ARRAY_CLEAN(a)
Datum contains(PG_FUNCTION_ARGS)
LWT_EDGERING_ELEM ** elems