Returns boolean true if the second argument is fully contained in a buffer of the first argument.
2689{
2694 double radius = PG_GETARG_FLOAT8(2);
2695 GEOSGeometry *buffer1 = NULL;
2696 GEOSGeometry *geos1 = NULL, *geos2 = NULL;
2697 char contained;
2698
2699 if (radius < 0.0)
2700 {
2701 elog(ERROR, "Tolerance cannot be less than zero\n");
2702 PG_RETURN_NULL();
2703 }
2704
2706
2708 PG_RETURN_BOOL(false);
2709
2711 PG_RETURN_BOOL(false);
2712
2714
2719 if (!(geos1 && geos2))
2721
2722 buffer1 = GEOSBuffer(geos1, radius, 16);
2723 GEOSGeom_destroy(geos1);
2724 if (!(buffer1))
2726
2727 contained = GEOSCovers(buffer1, geos2);
2728 GEOSGeom_destroy(buffer1);
2729 GEOSGeom_destroy(geos2);
2730
2732
2733 PG_FREE_IF_COPY(geom1, 0);
2734 PG_FREE_IF_COPY(geom2, 1);
2735
2736 PG_RETURN_BOOL(contained == 1);
2737}
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)