PostGIS  2.5.2dev-r@@SVN_REVISION@@

◆ LWGEOM_length2d_linestring()

Datum LWGEOM_length2d_linestring ( PG_FUNCTION_ARGS  )

Definition at line 298 of file lwgeom_functions_basic.c.

References dumpnode::geom, lwgeom_free(), lwgeom_from_gserialized(), lwgeom_length_2d(), LWGEOM_length_linestring(), and PG_FUNCTION_INFO_V1().

Referenced by LWGEOM_area_polygon().

299 {
300  GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P(0);
301  LWGEOM *lwgeom = lwgeom_from_gserialized(geom);
302  double dist = lwgeom_length_2d(lwgeom);
303  lwgeom_free(lwgeom);
304  PG_FREE_IF_COPY(geom, 0);
305  PG_RETURN_FLOAT8(dist);
306 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1144
double lwgeom_length_2d(const LWGEOM *geom)
Definition: lwgeom.c:1946
LWGEOM * geom
Here is the call graph for this function:
Here is the caller graph for this function: