758{
759 double maxdist;
762 double tolerance = PG_GETARG_FLOAT8(2);
765
766 if (tolerance < 0)
767 {
768 elog(ERROR, "Tolerance cannot be less than zero\n");
769 PG_RETURN_NULL();
770 }
771
773
775
776 PG_FREE_IF_COPY(geom1, 0);
777 PG_FREE_IF_COPY(geom2, 1);
778
779
780 if (maxdist > -1)
781 PG_RETURN_BOOL(tolerance >= maxdist);
782
784}
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_maxdistance2d_tolerance(const LWGEOM *lw1, const LWGEOM *lw2, double tolerance)
Function handling max distance calculations and dfullywithin calculations.