PostGIS  3.0.0dev-r@@SVN_REVISION@@

◆ ST_BuildArea()

Datum ST_BuildArea ( PG_FUNCTION_ARGS  )

Definition at line 3060 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().

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