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.
5884 const GEOSPreparedGeometry *ppoly;
5885 GEOSGeometry *polyg;
5889 LWDEBUGF(1,
"Working tolerance:%.15g", tol);
5892 for ( i=0; i<poly->
nrings; ++i )
5905 lwerror(
"Error adding ring %d of polygon", i);
5920 if ( nfacesinbox == -1 )
5937 ppoly = GEOSPrepare(polyg);
5939 for ( i=0; i<nfacesinbox; ++i )
5943 GEOSGeometry *fgg, *sp;
5951 GEOSPreparedGeom_destroy(ppoly);
5952 GEOSGeom_destroy(polyg);
5963 GEOSPreparedGeom_destroy(ppoly);
5964 GEOSGeom_destroy(polyg);
5969 sp = GEOSPointOnSurface(fgg);
5970 GEOSGeom_destroy(fgg);
5973 GEOSPreparedGeom_destroy(ppoly);
5974 GEOSGeom_destroy(polyg);
5979 covers = GEOSPreparedCovers( ppoly, sp );
5980 GEOSGeom_destroy(sp);
5983 GEOSPreparedGeom_destroy(ppoly);
5984 GEOSGeom_destroy(polyg);
5997 GEOSPreparedGeom_destroy(ppoly);
5998 GEOSGeom_destroy(polyg);
POINTARRAY * ptarray_clone(const POINTARRAY *ptarray)
Clone a POINTARRAY object.
Datum covers(PG_FUNCTION_ARGS)
void gbox_expand(GBOX *g, double d)
Move the box minimums down and the maximums up by the distance provided.
void lwgeom_free(LWGEOM *geom)
void lwline_free(LWLINE *line)
char lwgeom_geos_errmsg[LWGEOM_GEOS_ERRMSG_MAXSIZE]
#define _LWT_MINTOLERANCE(topo, geom)
LWT_ELEMID * lwt_AddLine(LWT_TOPOLOGY *topo, LWLINE *line, double tol, int *nedges)
Adds a linestring to the topology.
LWGEOM * lwpoly_as_lwgeom(const LWPOLY *obj)
LWLINE * lwline_construct(int srid, GBOX *bbox, POINTARRAY *points)
const LWT_BE_IFACE * be_iface
const GBOX * lwgeom_get_bbox(const LWGEOM *lwgeom)
Get a non-empty geometry bounding box, computing and caching it if not already there.
static LWT_ISO_FACE * lwt_be_getFaceWithinBox2D(const LWT_TOPOLOGY *topo, const GBOX *box, int *numelems, int fields, int limit)
GEOSGeometry * LWGEOM2GEOS(const LWGEOM *lwgeom, int autofix)
LWGEOM * lwt_GetFaceGeometry(LWT_TOPOLOGY *topo, LWT_ELEMID faceid)
Return the geometry of a face.
LWT_INT64 LWT_ELEMID
Identifier of topology element.
static void _lwt_release_faces(LWT_ISO_FACE *faces, int num_faces)
void * lwalloc(size_t size)
#define LWDEBUGF(level, msg,...)
const char * lwt_be_lastErrorMessage(const LWT_BE_IFACE *be)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.