726{
727 double mindist;
730 double tolerance = PG_GETARG_FLOAT8(2);
733
734 if (tolerance < 0)
735 {
736 elog(ERROR, "Tolerance cannot be less than zero\n");
737 PG_RETURN_NULL();
738 }
739
741
743
744 PG_FREE_IF_COPY(geom1, 0);
745 PG_FREE_IF_COPY(geom2, 1);
746
747
748 PG_RETURN_BOOL(tolerance >= mindist);
749}
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.
double lwgeom_mindistance2d_tolerance(const LWGEOM *lw1, const LWGEOM *lw2, double tolerance)
Function handling min distance calculations and dwithin calculations.