PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ ST_CollectionHomogenize()

Datum ST_CollectionHomogenize ( PG_FUNCTION_ARGS  )

Definition at line 2761 of file lwgeom_functions_basic.c.

2762 {
2763  GSERIALIZED *input = PG_GETARG_GSERIALIZED_P(0);
2764  GSERIALIZED *output;
2765  LWGEOM *lwgeom = lwgeom_from_gserialized(input);
2766  LWGEOM *lwoutput = NULL;
2767 
2768  lwoutput = lwgeom_homogenize(lwgeom);
2769  lwgeom_free(lwgeom);
2770 
2771  if (!lwoutput)
2772  {
2773  PG_FREE_IF_COPY(input, 0);
2774  PG_RETURN_NULL();
2775  }
2776 
2777  output = geometry_serialize(lwoutput);
2778  lwgeom_free(lwoutput);
2779 
2780  PG_FREE_IF_COPY(input, 0);
2781  PG_RETURN_POINTER(output);
2782 }
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
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)

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

Here is the call graph for this function: