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

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

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

3214 {
3215  GSERIALIZED *result;
3216  GSERIALIZED *geom;
3217  LWGEOM *lwgeom_in, *lwgeom_out;
3218 
3219  geom = PG_GETARG_GSERIALIZED_P(0);
3220  lwgeom_in = lwgeom_from_gserialized(geom);
3221 
3222  lwgeom_out = lwgeom_buildarea(lwgeom_in);
3223  lwgeom_free(lwgeom_in) ;
3224 
3225  if ( ! lwgeom_out )
3226  {
3227  PG_FREE_IF_COPY(geom, 0);
3228  PG_RETURN_NULL();
3229  }
3230 
3231  result = geometry_serialize(lwgeom_out) ;
3232  lwgeom_free(lwgeom_out) ;
3233 
3234  PG_FREE_IF_COPY(geom, 0);
3235  PG_RETURN_POINTER(result);
3236 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1137
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: