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

Definition at line 2578 of file lwgeom_functions_basic.c.

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

2579 {
2580  GSERIALIZED *input = PG_GETARG_GSERIALIZED_P(0);
2581  GSERIALIZED *output;
2582  LWGEOM *lwgeom = lwgeom_from_gserialized(input);
2583  LWGEOM *lwoutput = NULL;
2584 
2585  lwoutput = lwgeom_homogenize(lwgeom);
2586  lwgeom_free(lwgeom);
2587 
2588  if ( ! lwoutput )
2589  {
2590  PG_RETURN_NULL();
2591  PG_FREE_IF_COPY(input, 0);
2592  }
2593 
2594  output = geometry_serialize(lwoutput);
2595  lwgeom_free(lwoutput);
2596 
2597  PG_FREE_IF_COPY(input, 0);
2598  PG_RETURN_POINTER(output);
2599 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1050
LWGEOM * lwgeom_homogenize(const LWGEOM *geom)
Definition: lwhomogenize.c:195
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)

Here is the call graph for this function: