PostGIS  2.1.10dev-r@@SVN_REVISION@@
Datum LWGEOM_length2d_ellipsoid ( PG_FUNCTION_ARGS  )

Definition at line 324 of file lwgeom_spheroid.c.

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

325 {
326  GSERIALIZED *geom = (GSERIALIZED *)PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
327  SPHEROID *sphere = (SPHEROID *) PG_GETARG_POINTER(1);
328  LWGEOM *lwgeom = lwgeom_from_gserialized(geom);
329  double dist = lwgeom_length_spheroid(lwgeom, sphere);
330  lwgeom_free(lwgeom);
331  PG_FREE_IF_COPY(geom, 0);
332  PG_RETURN_FLOAT8(dist);
333 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1006
double lwgeom_length_spheroid(const LWGEOM *geom, const SPHEROID *s)
Calculate the geodetic length of a lwgeom on the unit sphere.
Definition: lwgeodetic.c:2881
LWGEOM * geom

Here is the call graph for this function: