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.
7551 uint64_t nfacesinbox;
7555 const GEOSPreparedGeometry *ppoly;
7556 GEOSGeometry *polyg;
7567 LWDEBUGF(1,
"Working tolerance:%.15g", tol);
7579 if (nfacesinbox == UINT64_MAX)
7596 ppoly = GEOSPrepare(polyg);
7598 for ( j=0; j<nfacesinbox; ++j )
7602 GEOSGeometry *fgg, *sp;
7610 GEOSPreparedGeom_destroy(ppoly);
7611 GEOSGeom_destroy(polyg);
7622 GEOSPreparedGeom_destroy(ppoly);
7623 GEOSGeom_destroy(polyg);
7628 sp = GEOSPointOnSurface(fgg);
7629 GEOSGeom_destroy(fgg);
7632 GEOSPreparedGeom_destroy(ppoly);
7633 GEOSGeom_destroy(polyg);
7638 covers = GEOSPreparedCovers( ppoly, sp );
7639 GEOSGeom_destroy(sp);
7642 GEOSPreparedGeom_destroy(ppoly);
7643 GEOSGeom_destroy(polyg);
7656 GEOSPreparedGeom_destroy(ppoly);
7657 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)
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)
int lwpoly_is_empty(const LWPOLY *poly)
LWT_INT64 LWT_ELEMID
Identifier of topology element.
#define PGTOPO_BE_ERROR()
Datum covers(PG_FUNCTION_ARGS)
#define LWDEBUGF(level, msg,...)
void void lwerror(const char *fmt,...) __attribute__((format(printf
Write a notice out to the error handler.
LWGEOM * lwt_GetFaceGeometry(LWT_TOPOLOGY *topo, LWT_ELEMID faceid)
Return the geometry of a face.
void _lwt_release_faces(LWT_ISO_FACE *faces, int num_faces)
LWT_ISO_FACE * lwt_be_getFaceWithinBox2D(const LWT_TOPOLOGY *topo, const GBOX *box, uint64_t *numelems, int fields, uint64_t limit)
static void lwt_LoadPolygon(LWT_TOPOLOGY *topo, const LWPOLY *poly, double tol)
#define _LWT_MINTOLERANCE(topo, geom)