PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ ST_CollectionHomogenize()

Datum ST_CollectionHomogenize ( PG_FUNCTION_ARGS  )

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

2607 {
2608  GSERIALIZED *input = PG_GETARG_GSERIALIZED_P(0);
2609  GSERIALIZED *output;
2610  LWGEOM *lwgeom = lwgeom_from_gserialized(input);
2611  LWGEOM *lwoutput = NULL;
2612 
2613  lwoutput = lwgeom_homogenize(lwgeom);
2614  lwgeom_free(lwgeom);
2615 
2616  if ( ! lwoutput )
2617  {
2618  PG_RETURN_NULL();
2619  PG_FREE_IF_COPY(input, 0);
2620  }
2621 
2622  output = geometry_serialize(lwoutput);
2623  lwgeom_free(lwoutput);
2624 
2625  PG_FREE_IF_COPY(input, 0);
2626  PG_RETURN_POINTER(output);
2627 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1099
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: