PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ LWGEOM_length2d_ellipsoid()

Datum LWGEOM_length2d_ellipsoid ( PG_FUNCTION_ARGS  )

Definition at line 337 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().

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