PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ ST_CPAWithin()

Datum ST_CPAWithin ( PG_FUNCTION_ARGS  )

Definition at line 98 of file lwgeom_functions_temporal.c.

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

Referenced by ST_DistanceCPA().

99 {
100  GSERIALIZED *gs0 = PG_GETARG_GSERIALIZED_P(0);
101  GSERIALIZED *gs1 = PG_GETARG_GSERIALIZED_P(1);
102  double maxdist = PG_GETARG_FLOAT8(2);
103  /* All checks already performed by liblwgeom, not worth checking again */
104  LWGEOM *g0 = lwgeom_from_gserialized(gs0);
105  LWGEOM *g1 = lwgeom_from_gserialized(gs1);
106  int ret = lwgeom_cpa_within(g0, g1, maxdist);
107  lwgeom_free(g0);
108  lwgeom_free(g1);
109  PG_FREE_IF_COPY(gs0, 0);
110  PG_FREE_IF_COPY(gs1, 1);
111  PG_RETURN_BOOL( ret == LW_TRUE );
112 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1050
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:61
Here is the call graph for this function:
Here is the caller graph for this function: