PostGIS  2.5.0dev-r@@SVN_REVISION@@

◆ LWGEOM_length_linestring()

Datum LWGEOM_length_linestring ( PG_FUNCTION_ARGS  )

Definition at line 316 of file lwgeom_functions_basic.c.

References dumpnode::geom, lwgeom_free(), lwgeom_from_gserialized(), lwgeom_length(), LWGEOM_perimeter_poly(), and PG_FUNCTION_INFO_V1().

Referenced by LWGEOM_length2d_linestring().

317 {
318  GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P(0);
319  LWGEOM *lwgeom = lwgeom_from_gserialized(geom);
320  double dist = lwgeom_length(lwgeom);
321  lwgeom_free(lwgeom);
322  PG_FREE_IF_COPY(geom, 0);
323  PG_RETURN_FLOAT8(dist);
324 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1144
LWGEOM * geom
double lwgeom_length(const LWGEOM *geom)
Definition: lwgeom.c:1924
Here is the call graph for this function:
Here is the caller graph for this function: