PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ ST_BuildArea()

Datum ST_BuildArea ( PG_FUNCTION_ARGS  )

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

3060 {
3061  GSERIALIZED *result;
3062  GSERIALIZED *geom;
3063  LWGEOM *lwgeom_in, *lwgeom_out;
3064 
3065  geom = PG_GETARG_GSERIALIZED_P(0);
3066  lwgeom_in = lwgeom_from_gserialized(geom);
3067 
3068  lwgeom_out = lwgeom_buildarea(lwgeom_in);
3069  lwgeom_free(lwgeom_in) ;
3070 
3071  if ( ! lwgeom_out )
3072  {
3073  PG_FREE_IF_COPY(geom, 0);
3074  PG_RETURN_NULL();
3075  }
3076 
3077  result = geometry_serialize(lwgeom_out) ;
3078  lwgeom_free(lwgeom_out) ;
3079 
3080  PG_FREE_IF_COPY(geom, 0);
3081  PG_RETURN_POINTER(result);
3082 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1144
LWGEOM * lwgeom_buildarea(const LWGEOM *geom)
Take a geometry and return an areal geometry (Polygon or MultiPolygon).
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)

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

Here is the call graph for this function: