6625 const GBOX *minenv = NULL;
6627 const GBOX *testbox;
6628 GEOSGeometry *ghole;
6646 if ( ! shells->
tree )
6649 LWDEBUG(1,
"Building STRtree");
6651 if (shells->
tree == NULL)
6656 for (i=0; i<shells->
size; ++i)
6660 LWDEBUGF(2,
"GBOX of shell %p for edge %d is %g %g,%g %g",
6666 pt.
x = shellbox->
xmin;
6667 pt.
y = shellbox->
ymin;
6669 pt.
x = shellbox->
xmax;
6670 pt.
y = shellbox->
ymax;
6677 GEOSSTRtree_insert(shells->
tree, sring->
genv, sring);
6679 LWDEBUG(1,
"STRtree build completed");
6685 LWDEBUGF(1,
"Found %d candidate shells containing first point of ring's originating edge %d",
6690 for (i=0; i<candidates.
size; ++i)
6698 LWDEBUGF(1,
"Shell %d is on other side of ring",
6706 LWDEBUGF(1,
"Bbox of shell %d equals that of hole ring",
6714 LWDEBUGF(1,
"Bbox of shell %d does not contain bbox of ring point",
6723 LWDEBUGF(2,
"Bbox of shell %d (face %d) not contained by bbox "
6724 "of last shell found to contain the point",
6735 LWDEBUGF(1,
"Shell %d contains hole of edge %d",
6742 if ( foundInFace == -1 ) foundInFace = 0;
6744 candidates.
size = 0;
6747 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)
LWGEOM * lwline_as_lwgeom(const LWLINE *obj)
LWPOINT * lwpoint_make2d(int32_t srid, double x, double y)
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...
LWLINE * lwline_construct(int32_t srid, GBOX *bbox, POINTARRAY *points)
LWGEOM * lwpoint_as_lwgeom(const LWPOINT *obj)
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