PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ ST_CollectionHomogenize()

Datum ST_CollectionHomogenize ( PG_FUNCTION_ARGS  )

Definition at line 2745 of file lwgeom_functions_basic.c.

2746 {
2747  GSERIALIZED *input = PG_GETARG_GSERIALIZED_P(0);
2748  GSERIALIZED *output;
2749  LWGEOM *lwgeom = lwgeom_from_gserialized(input);
2750  LWGEOM *lwoutput = NULL;
2751 
2752  lwoutput = lwgeom_homogenize(lwgeom);
2753  lwgeom_free(lwgeom);
2754 
2755  if (!lwoutput)
2756  {
2757  PG_FREE_IF_COPY(input, 0);
2758  PG_RETURN_NULL();
2759  }
2760 
2761  output = geometry_serialize(lwoutput);
2762  lwgeom_free(lwoutput);
2763 
2764  PG_FREE_IF_COPY(input, 0);
2765  PG_RETURN_POINTER(output);
2766 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1144
LWGEOM * lwgeom_homogenize(const LWGEOM *geom)
Definition: lwhomogenize.c:211
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)

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

Here is the call graph for this function: