PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ LWGEOM_length2d_ellipsoid()

Datum LWGEOM_length2d_ellipsoid ( PG_FUNCTION_ARGS  )

Definition at line 324 of file lwgeom_spheroid.c.

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

Referenced by distance_ellipse_calculation().

325 {
326  GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P(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:1050
double lwgeom_length_spheroid(const LWGEOM *geom, const SPHEROID *s)
Calculate the geodetic length of a lwgeom on the unit sphere.
Definition: lwgeodetic.c:2884
Here is the call graph for this function:
Here is the caller graph for this function: