PostGIS  2.5.0beta2dev-r@@SVN_REVISION@@

◆ ST_CollectionHomogenize()

Datum ST_CollectionHomogenize ( PG_FUNCTION_ARGS  )

Definition at line 2734 of file lwgeom_functions_basic.c.

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

Referenced by ST_CollectionExtract().

2735 {
2736  GSERIALIZED *input = PG_GETARG_GSERIALIZED_P(0);
2737  GSERIALIZED *output;
2738  LWGEOM *lwgeom = lwgeom_from_gserialized(input);
2739  LWGEOM *lwoutput = NULL;
2740 
2741  lwoutput = lwgeom_homogenize(lwgeom);
2742  lwgeom_free(lwgeom);
2743 
2744  if (!lwoutput)
2745  {
2746  PG_FREE_IF_COPY(input, 0);
2747  PG_RETURN_NULL();
2748  }
2749 
2750  output = geometry_serialize(lwoutput);
2751  lwgeom_free(lwoutput);
2752 
2753  PG_FREE_IF_COPY(input, 0);
2754  PG_RETURN_POINTER(output);
2755 }
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)
Here is the call graph for this function:
Here is the caller graph for this function: