Adds a polygon to the topology.
The boundary of the given polygon will snap to existing nodes or edges within given tolerance. Existing edges or faces may be split by the boundary of the polygon.
5936 uint64_t nfacesinbox;
5940 const GEOSPreparedGeometry *ppoly;
5941 GEOSGeometry *polyg;
5952 LWDEBUGF(1,
"Working tolerance:%.15g", tol);
5955 for ( i=0; i<poly->
nrings; ++i )
5968 lwerror(
"Error adding ring %d of polygon", i);
5983 if (nfacesinbox == UINT64_MAX)
6000 ppoly = GEOSPrepare(polyg);
6002 for ( j=0; j<nfacesinbox; ++j )
6006 GEOSGeometry *fgg, *sp;
6014 GEOSPreparedGeom_destroy(ppoly);
6015 GEOSGeom_destroy(polyg);
6026 GEOSPreparedGeom_destroy(ppoly);
6027 GEOSGeom_destroy(polyg);
6032 sp = GEOSPointOnSurface(fgg);
6033 GEOSGeom_destroy(fgg);
6036 GEOSPreparedGeom_destroy(ppoly);
6037 GEOSGeom_destroy(polyg);
6042 covers = GEOSPreparedCovers( ppoly, sp );
6043 GEOSGeom_destroy(sp);
6046 GEOSPreparedGeom_destroy(ppoly);
6047 GEOSGeom_destroy(polyg);
6060 GEOSPreparedGeom_destroy(ppoly);
6061 GEOSGeom_destroy(polyg);
void gbox_expand(GBOX *g, double d)
Move the box minimums down and the maximums up by the distance provided.
char lwgeom_geos_errmsg[LWGEOM_GEOS_ERRMSG_MAXSIZE]
GEOSGeometry * LWGEOM2GEOS(const LWGEOM *lwgeom, uint8_t autofix)
void lwgeom_free(LWGEOM *geom)
LWGEOM * lwpoly_as_lwgeom(const LWPOLY *obj)
LWLINE * lwline_construct(int32_t srid, GBOX *bbox, POINTARRAY *points)
const GBOX * lwgeom_get_bbox(const LWGEOM *lwgeom)
Get a non-empty geometry bounding box, computing and caching it if not already there.
void * lwalloc(size_t size)
void lwline_free(LWLINE *line)
POINTARRAY * ptarray_clone(const POINTARRAY *ptarray)
Clone a POINTARRAY object.
int lwpoly_is_empty(const LWPOLY *poly)
LWT_INT64 LWT_ELEMID
Identifier of topology element.
#define LWDEBUGF(level, msg,...)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
static LWT_ISO_FACE * lwt_be_getFaceWithinBox2D(const LWT_TOPOLOGY *topo, const GBOX *box, uint64_t *numelems, int fields, uint64_t limit)
const char * lwt_be_lastErrorMessage(const LWT_BE_IFACE *be)
LWGEOM * lwt_GetFaceGeometry(LWT_TOPOLOGY *topo, LWT_ELEMID faceid)
Return the geometry of a face.
LWT_ELEMID * lwt_AddLine(LWT_TOPOLOGY *topo, LWLINE *line, double tol, int *nedges)
Adds a linestring to the topology.
static void _lwt_release_faces(LWT_ISO_FACE *faces, int num_faces)
#define _LWT_MINTOLERANCE(topo, geom)
Datum covers(PG_FUNCTION_ARGS)
const LWT_BE_IFACE * be_iface