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

Definition at line 270 of file lwgeom_functions_basic.c.

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

271 {
272  GSERIALIZED *geom = (GSERIALIZED *)PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
273  LWGEOM *lwgeom = lwgeom_from_gserialized(geom);
274  double dist = lwgeom_length_2d(lwgeom);
275  lwgeom_free(lwgeom);
276  PG_FREE_IF_COPY(geom, 0);
277  PG_RETURN_FLOAT8(dist);
278 }
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_2d(const LWGEOM *geom)
Definition: lwgeom.c:1588
LWGEOM * geom

Here is the call graph for this function: