PostGIS  3.7.0dev-r@@SVN_REVISION@@

◆ ST_CollectionHomogenize()

Datum ST_CollectionHomogenize ( PG_FUNCTION_ARGS  )

Definition at line 2989 of file lwgeom_functions_basic.c.

2990 {
2991  GSERIALIZED *input = PG_GETARG_GSERIALIZED_P(0);
2992  GSERIALIZED *output;
2993  LWGEOM *lwgeom = lwgeom_from_gserialized(input);
2994  LWGEOM *lwoutput = NULL;
2995 
2996  lwoutput = lwgeom_homogenize(lwgeom);
2997  lwgeom_free(lwgeom);
2998 
2999  if (!lwoutput)
3000  {
3001  PG_FREE_IF_COPY(input, 0);
3002  PG_RETURN_NULL();
3003  }
3004 
3005  output = geometry_serialize(lwoutput);
3006  lwgeom_free(lwoutput);
3007 
3008  PG_FREE_IF_COPY(input, 0);
3009  PG_RETURN_POINTER(output);
3010 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
Definition: gserialized.c:268
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1246
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: