PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ LWGEOM_length2d_ellipsoid()

Datum LWGEOM_length2d_ellipsoid ( PG_FUNCTION_ARGS  )

Definition at line 337 of file lwgeom_spheroid.c.

338 {
339  GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P(0);
340  SPHEROID *sphere = (SPHEROID *) PG_GETARG_POINTER(1);
341  LWGEOM *lwgeom = lwgeom_from_gserialized(geom);
342  double dist = lwgeom_length_spheroid(lwgeom, sphere);
343  lwgeom_free(lwgeom);
344  PG_FREE_IF_COPY(geom, 0);
345  PG_RETURN_FLOAT8(dist);
346 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1144
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: