PostGIS  2.5.0beta1dev-r@@SVN_REVISION@@

◆ ST_BuildArea()

Datum ST_BuildArea ( PG_FUNCTION_ARGS  )

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

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

Referenced by linemerge().

3063 {
3064  GSERIALIZED *result;
3065  GSERIALIZED *geom;
3066  LWGEOM *lwgeom_in, *lwgeom_out;
3067 
3068  geom = PG_GETARG_GSERIALIZED_P(0);
3069  lwgeom_in = lwgeom_from_gserialized(geom);
3070 
3071  lwgeom_out = lwgeom_buildarea(lwgeom_in);
3072  lwgeom_free(lwgeom_in) ;
3073 
3074  if ( ! lwgeom_out )
3075  {
3076  PG_FREE_IF_COPY(geom, 0);
3077  PG_RETURN_NULL();
3078  }
3079 
3080  result = geometry_serialize(lwgeom_out) ;
3081  lwgeom_free(lwgeom_out) ;
3082 
3083  PG_FREE_IF_COPY(geom, 0);
3084  PG_RETURN_POINTER(result);
3085 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1144
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:
Here is the caller graph for this function: