PostGIS  2.1.10dev-r@@SVN_REVISION@@
Datum ST_CollectionHomogenize ( PG_FUNCTION_ARGS  )

Definition at line 2647 of file lwgeom_functions_basic.c.

References geometry_serialize(), input(), lwgeom_free(), lwgeom_from_gserialized(), and lwgeom_homogenize().

2648 {
2649  GSERIALIZED *input = (GSERIALIZED *)PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
2650  GSERIALIZED *output;
2651  LWGEOM *lwgeom = lwgeom_from_gserialized(input);
2652  LWGEOM *lwoutput = NULL;
2653 
2654  lwoutput = lwgeom_homogenize(lwgeom);
2655  lwgeom_free(lwgeom);
2656  PG_FREE_IF_COPY(input, 0);
2657 
2658  if ( ! lwoutput )
2659  PG_RETURN_NULL();
2660 
2661  output = geometry_serialize(lwoutput);
2662  lwgeom_free(lwoutput);
2663 
2664  PG_RETURN_POINTER(output);
2665 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1006
static int input(void)
LWGEOM * lwgeom_homogenize(const LWGEOM *geom)
Definition: lwhomogenize.c:196
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)

Here is the call graph for this function: