PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ ST_ClosestPointOfApproach()

Datum ST_ClosestPointOfApproach ( PG_FUNCTION_ARGS  )

Definition at line 47 of file lwgeom_functions_temporal.c.

48 {
49  GSERIALIZED *gs0 = PG_GETARG_GSERIALIZED_P(0);
50  GSERIALIZED *gs1 = PG_GETARG_GSERIALIZED_P(1);
51  /* All checks already performed by liblwgeom, not worth checking again */
54  double m = lwgeom_tcpa(g0, g1, NULL);
55  lwgeom_free(g0);
56  lwgeom_free(g1);
57  PG_FREE_IF_COPY(gs0, 0);
58  PG_FREE_IF_COPY(gs1, 1);
59  if ( m < 0 ) PG_RETURN_NULL();
60  PG_RETURN_FLOAT8(m);
61 }
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
double lwgeom_tcpa(const LWGEOM *g1, const LWGEOM *g2, double *mindist)
Find the time of closest point of approach.

References lwgeom_free(), lwgeom_from_gserialized(), and lwgeom_tcpa().

Here is the call graph for this function: