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

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

References dumpnode::geom, geometry_serialize(), lwgeom_buildarea(), lwgeom_free(), and lwgeom_from_gserialized().

3596 {
3597  GSERIALIZED *result;
3598  GSERIALIZED *geom;
3599  LWGEOM *lwgeom_in, *lwgeom_out;
3600 
3601  geom = PG_GETARG_GSERIALIZED_P(0);
3602  lwgeom_in = lwgeom_from_gserialized(geom);
3603 
3604  lwgeom_out = lwgeom_buildarea(lwgeom_in);
3605  lwgeom_free(lwgeom_in) ;
3606 
3607  if ( ! lwgeom_out )
3608  {
3609  PG_FREE_IF_COPY(geom, 0);
3610  PG_RETURN_NULL();
3611  }
3612 
3613  result = geometry_serialize(lwgeom_out) ;
3614  lwgeom_free(lwgeom_out) ;
3615 
3616  PG_FREE_IF_COPY(geom, 0);
3617  PG_RETURN_POINTER(result);
3618 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1050
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: