PostGIS  2.5.0dev-r@@SVN_REVISION@@
Datum ST_Normalize ( PG_FUNCTION_ARGS  )

Definition at line 1941 of file lwgeom_functions_basic.c.

References geometry_serialize(), lwgeom_free(), lwgeom_from_gserialized(), lwgeom_normalize(), and lwgeom_summary().

1942 {
1943  GSERIALIZED *in, *out;
1944  LWGEOM *lwgeom_in, *lwgeom_out;
1945 
1946  POSTGIS_DEBUG(2, "ST_Normalize called");
1947 
1948  in = PG_GETARG_GSERIALIZED_P_COPY(0);
1949 
1950  lwgeom_in = lwgeom_from_gserialized(in);
1951  POSTGIS_DEBUGF(3, "Deserialized: %s", lwgeom_summary(lwgeom_in, 0));
1952 
1953  lwgeom_out = lwgeom_normalize(lwgeom_in);
1954  POSTGIS_DEBUGF(3, "Normalized: %s", lwgeom_summary(lwgeom_out, 0));
1955 
1956  out = geometry_serialize(lwgeom_out);
1957  lwgeom_free(lwgeom_in);
1958  lwgeom_free(lwgeom_out);
1959 
1960  PG_FREE_IF_COPY(in, 0);
1961 
1962  PG_RETURN_POINTER(out);
1963 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1137
LWGEOM * lwgeom_normalize(const LWGEOM *geom)
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)
char * lwgeom_summary(const LWGEOM *lwgeom, int offset)
Definition: lwgeom_debug.c:158

Here is the call graph for this function: