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

Definition at line 246 of file lwgeom_functions_basic.c.

References area(), lwgeom_area(), lwgeom_free(), and lwgeom_from_gserialized().

247 {
248  GSERIALIZED *geom = (GSERIALIZED *)PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
249  LWGEOM *lwgeom = lwgeom_from_gserialized(geom);
250  double area = 0.0;
251 
252  POSTGIS_DEBUG(2, "in LWGEOM_area_polygon");
253 
254  area = lwgeom_area(lwgeom);
255 
256  lwgeom_free(lwgeom);
257  PG_FREE_IF_COPY(geom, 0);
258 
259  PG_RETURN_FLOAT8(area);
260 }
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:1006
LWGEOM * geom
double lwgeom_area(const LWGEOM *geom)
Definition: lwgeom.c:1499

Here is the call graph for this function: