PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ ST_CPAWithin()

Datum ST_CPAWithin ( PG_FUNCTION_ARGS  )

Definition at line 110 of file lwgeom_functions_temporal.c.

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

Referenced by ST_DistanceCPA().

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