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

Definition at line 3398 of file postgis/lwgeom_geos.c.

References geometry_serialize(), lwgeom_buildarea(), lwgeom_free(), lwgeom_from_gserialized(), and result.

3399 {
3401  GSERIALIZED *geom;
3402  LWGEOM *lwgeom_in, *lwgeom_out;
3403 
3404  geom = (GSERIALIZED*)PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
3405  lwgeom_in = lwgeom_from_gserialized(geom);
3406 
3407  lwgeom_out = lwgeom_buildarea(lwgeom_in);
3408  lwgeom_free(lwgeom_in) ;
3409 
3410  if ( ! lwgeom_out ) {
3411  PG_FREE_IF_COPY(geom, 0);
3412  PG_RETURN_NULL();
3413  }
3414 
3415  result = geometry_serialize(lwgeom_out) ;
3416  lwgeom_free(lwgeom_out) ;
3417 
3418  PG_FREE_IF_COPY(geom, 0);
3419  PG_RETURN_POINTER(result);
3420 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1006
char ** result
Definition: liblwgeom.h:218
LWGEOM * geom
LWGEOM * lwgeom_buildarea(const LWGEOM *geom)
Take a geometry and return an areal geometry (Polygon or MultiPolygon).
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)

Here is the call graph for this function: