PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ LWGEOM_area_polygon()

Datum LWGEOM_area_polygon ( PG_FUNCTION_ARGS  )

Definition at line 270 of file lwgeom_functions_basic.c.

References area(), dumpnode::geom, lwgeom_area(), lwgeom_free(), lwgeom_from_gserialized(), LWGEOM_length2d_linestring(), and PG_FUNCTION_INFO_V1().

Referenced by LWGEOM_nrings().

271 {
272  GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P(0);
273  LWGEOM *lwgeom = lwgeom_from_gserialized(geom);
274  double area = 0.0;
275 
276  POSTGIS_DEBUG(2, "in LWGEOM_area_polygon");
277 
278  area = lwgeom_area(lwgeom);
279 
280  lwgeom_free(lwgeom);
281  PG_FREE_IF_COPY(geom, 0);
282 
283  PG_RETURN_FLOAT8(area);
284 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
Datum area(PG_FUNCTION_ARGS)
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1099
LWGEOM * geom
double lwgeom_area(const LWGEOM *geom)
Definition: lwgeom.c:1623
Here is the call graph for this function:
Here is the caller graph for this function: