PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ ST_Normalize()

Datum ST_Normalize ( PG_FUNCTION_ARGS  )

Definition at line 1937 of file lwgeom_functions_basic.c.

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

Referenced by LWGEOM_noop().

1938 {
1939  GSERIALIZED *in, *out;
1940  LWGEOM *lwgeom_in, *lwgeom_out;
1941 
1942  POSTGIS_DEBUG(2, "ST_Normalize called");
1943 
1944  in = PG_GETARG_GSERIALIZED_P_COPY(0);
1945 
1946  lwgeom_in = lwgeom_from_gserialized(in);
1947  POSTGIS_DEBUGF(3, "Deserialized: %s", lwgeom_summary(lwgeom_in, 0));
1948 
1949  lwgeom_out = lwgeom_normalize(lwgeom_in);
1950  POSTGIS_DEBUGF(3, "Normalized: %s", lwgeom_summary(lwgeom_out, 0));
1951 
1952  out = geometry_serialize(lwgeom_out);
1953  lwgeom_free(lwgeom_in);
1954  lwgeom_free(lwgeom_out);
1955 
1956  PG_FREE_IF_COPY(in, 0);
1957 
1958  PG_RETURN_POINTER(out);
1959 }
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_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:
Here is the caller graph for this function: