PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ ST_CPAWithin()

Datum ST_CPAWithin ( PG_FUNCTION_ARGS  )

Definition at line 108 of file lwgeom_functions_temporal.c.

109 {
110  GSERIALIZED *gs0 = PG_GETARG_GSERIALIZED_P(0);
111  GSERIALIZED *gs1 = PG_GETARG_GSERIALIZED_P(1);
112  double maxdist = PG_GETARG_FLOAT8(2);
113  /* All checks already performed by liblwgeom, not worth checking again */
114  LWGEOM *g0 = lwgeom_from_gserialized(gs0);
115  LWGEOM *g1 = lwgeom_from_gserialized(gs1);
116  int ret = lwgeom_cpa_within(g0, g1, maxdist);
117  lwgeom_free(g0);
118  lwgeom_free(g1);
119  PG_FREE_IF_COPY(gs0, 0);
120  PG_FREE_IF_COPY(gs1, 1);
121  PG_RETURN_BOOL( ret == LW_TRUE );
122 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
Definition: gserialized.c:239
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1138
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:107
int lwgeom_cpa_within(const LWGEOM *g1, const LWGEOM *g2, double maxdist)
Is the closest point of approach within a distance ?

References LW_TRUE, lwgeom_cpa_within(), lwgeom_free(), and lwgeom_from_gserialized().

Here is the call graph for this function: