PostGIS  3.1.6dev-r@@SVN_REVISION@@

◆ ST_CollectionHomogenize()

Datum ST_CollectionHomogenize ( PG_FUNCTION_ARGS  )

Definition at line 2768 of file lwgeom_functions_basic.c.

2769 {
2770  GSERIALIZED *input = PG_GETARG_GSERIALIZED_P(0);
2771  GSERIALIZED *output;
2772  LWGEOM *lwgeom = lwgeom_from_gserialized(input);
2773  LWGEOM *lwoutput = NULL;
2774 
2775  lwoutput = lwgeom_homogenize(lwgeom);
2776  lwgeom_free(lwgeom);
2777 
2778  if (!lwoutput)
2779  {
2780  PG_FREE_IF_COPY(input, 0);
2781  PG_RETURN_NULL();
2782  }
2783 
2784  output = geometry_serialize(lwoutput);
2785  lwgeom_free(lwoutput);
2786 
2787  PG_FREE_IF_COPY(input, 0);
2788  PG_RETURN_POINTER(output);
2789 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
Definition: gserialized.c:239
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1138
LWGEOM * lwgeom_homogenize(const LWGEOM *geom)
Definition: lwhomogenize.c:208

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

Here is the call graph for this function: