PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ ST_CollectionHomogenize()

Datum ST_CollectionHomogenize ( PG_FUNCTION_ARGS  )

Definition at line 2997 of file lwgeom_functions_basic.c.

2998 {
2999  GSERIALIZED *input = PG_GETARG_GSERIALIZED_P(0);
3000  GSERIALIZED *output;
3001  LWGEOM *lwgeom = lwgeom_from_gserialized(input);
3002  LWGEOM *lwoutput = NULL;
3003 
3004  lwoutput = lwgeom_homogenize(lwgeom);
3005  lwgeom_free(lwgeom);
3006 
3007  if (!lwoutput)
3008  {
3009  PG_FREE_IF_COPY(input, 0);
3010  PG_RETURN_NULL();
3011  }
3012 
3013  output = geometry_serialize(lwoutput);
3014  lwgeom_free(lwoutput);
3015 
3016  PG_FREE_IF_COPY(input, 0);
3017  PG_RETURN_POINTER(output);
3018 }
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:1155
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: