PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ ST_BuildArea()

Datum ST_BuildArea ( PG_FUNCTION_ARGS  )

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

3363 {
3364  GSERIALIZED *result;
3365  GSERIALIZED *geom;
3366  LWGEOM *lwgeom_in, *lwgeom_out;
3367 
3368  geom = PG_GETARG_GSERIALIZED_P(0);
3369  lwgeom_in = lwgeom_from_gserialized(geom);
3370 
3371  lwgeom_out = lwgeom_buildarea(lwgeom_in);
3372  lwgeom_free(lwgeom_in) ;
3373 
3374  if ( ! lwgeom_out )
3375  {
3376  PG_FREE_IF_COPY(geom, 0);
3377  PG_RETURN_NULL();
3378  }
3379 
3380  result = geometry_serialize(lwgeom_out) ;
3381  lwgeom_free(lwgeom_out) ;
3382 
3383  PG_FREE_IF_COPY(geom, 0);
3384  PG_RETURN_POINTER(result);
3385 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1099
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: