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

Definition at line 2731 of file lwgeom_functions_basic.c.

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

2732 {
2733  GSERIALIZED *input = PG_GETARG_GSERIALIZED_P(0);
2734  GSERIALIZED *output;
2735  LWGEOM *lwgeom = lwgeom_from_gserialized(input);
2736  LWGEOM *lwoutput = NULL;
2737 
2738  lwoutput = lwgeom_homogenize(lwgeom);
2739  lwgeom_free(lwgeom);
2740 
2741  if (!lwoutput)
2742  {
2743  PG_FREE_IF_COPY(input, 0);
2744  PG_RETURN_NULL();
2745  }
2746 
2747  output = geometry_serialize(lwoutput);
2748  lwgeom_free(lwoutput);
2749 
2750  PG_FREE_IF_COPY(input, 0);
2751  PG_RETURN_POINTER(output);
2752 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1137
LWGEOM * lwgeom_homogenize(const LWGEOM *geom)
Definition: lwhomogenize.c:209
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)

Here is the call graph for this function: