PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ LWGEOM_length2d_ellipsoid()

Datum LWGEOM_length2d_ellipsoid ( PG_FUNCTION_ARGS  )

Definition at line 336 of file lwgeom_spheroid.c.

337 {
338  GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P(0);
339  SPHEROID *sphere = (SPHEROID *) PG_GETARG_POINTER(1);
340  LWGEOM *lwgeom = lwgeom_from_gserialized(geom);
341  double dist = lwgeom_length_spheroid(lwgeom, sphere);
342  lwgeom_free(lwgeom);
343  PG_FREE_IF_COPY(geom, 0);
344  PG_RETURN_FLOAT8(dist);
345 }
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_length_spheroid(const LWGEOM *geom, const SPHEROID *s)
Calculate the geodetic length of a lwgeom on the unit sphere.
Definition: lwgeodetic.c:3297

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

Here is the call graph for this function: