PostGIS  2.3.8dev-r@@SVN_REVISION@@

◆ ST_CollectionHomogenize()

Datum ST_CollectionHomogenize ( PG_FUNCTION_ARGS  )

Definition at line 2637 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().

2638 {
2639  GSERIALIZED *input = PG_GETARG_GSERIALIZED_P(0);
2640  GSERIALIZED *output;
2641  LWGEOM *lwgeom = lwgeom_from_gserialized(input);
2642  LWGEOM *lwoutput = NULL;
2643 
2644  lwoutput = lwgeom_homogenize(lwgeom);
2645  lwgeom_free(lwgeom);
2646 
2647  if ( ! lwoutput )
2648  {
2649  PG_RETURN_NULL();
2650  PG_FREE_IF_COPY(input, 0);
2651  }
2652 
2653  output = geometry_serialize(lwoutput);
2654  lwgeom_free(lwoutput);
2655 
2656  PG_FREE_IF_COPY(input, 0);
2657  PG_RETURN_POINTER(output);
2658 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1063
LWGEOM * lwgeom_homogenize(const LWGEOM *geom)
Definition: lwhomogenize.c:209
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)
Here is the call graph for this function:
Here is the caller graph for this function: