Returns boolean true if the second argument is fully contained in a buffer of the first argument.
2693 double radius = PG_GETARG_FLOAT8(2);
2694 GEOSGeometry *buffer1 = NULL;
2695 GEOSGeometry *geos1 = NULL, *geos2 = NULL;
2700 elog(ERROR,
"Tolerance cannot be less than zero\n");
2707 PG_RETURN_BOOL(
false);
2710 PG_RETURN_BOOL(
false);
2718 if (!(geos1 && geos2))
2721 buffer1 = GEOSBuffer(geos1, radius, 16);
2722 GEOSGeom_destroy(geos1);
2726 contained = GEOSCovers(buffer1, geos2);
2727 GEOSGeom_destroy(buffer1);
2728 GEOSGeom_destroy(geos2);
2732 PG_FREE_IF_COPY(geom1, 0);
2733 PG_FREE_IF_COPY(geom2, 1);
2735 PG_RETURN_BOOL(contained == 1);
void gserialized_error_if_srid_mismatch(const GSERIALIZED *g1, const GSERIALIZED *g2, const char *funcname)
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
GEOSGeometry * LWGEOM2GEOS(const LWGEOM *lwgeom, uint8_t autofix)
void lwgeom_geos_error(const char *fmt,...)
void lwgeom_free(LWGEOM *geom)
int lwgeom_isfinite(const LWGEOM *lwgeom)
Check if a LWGEOM has any non-finite (NaN or Inf) coordinates.
static int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members)
#define HANDLE_GEOS_ERROR(label)