PostGIS  2.1.10dev-r@@SVN_REVISION@@
Datum LWGEOM_force_clockwise_poly ( PG_FUNCTION_ARGS  )

Definition at line 1925 of file lwgeom_functions_basic.c.

References geometry_serialize(), lwgeom_force_clockwise(), lwgeom_free(), and lwgeom_from_gserialized().

1926 {
1927  GSERIALIZED *ingeom, *outgeom;
1928  LWGEOM *lwgeom;
1929 
1930  POSTGIS_DEBUG(2, "LWGEOM_force_clockwise_poly called");
1931 
1932  ingeom = (GSERIALIZED *)PG_DETOAST_DATUM_COPY(PG_GETARG_DATUM(0));
1933 
1934  lwgeom = lwgeom_from_gserialized(ingeom);
1935  lwgeom_force_clockwise(lwgeom);
1936 
1937  outgeom = geometry_serialize(lwgeom);
1938 
1939  lwgeom_free(lwgeom);
1940  PG_FREE_IF_COPY(ingeom, 0);
1941  PG_RETURN_POINTER(outgeom);
1942 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1006
void lwgeom_force_clockwise(LWGEOM *lwgeom)
Ensure the outer ring is clockwise oriented and all inner rings are counter-clockwise.
Definition: lwgeom.c:23
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)

Here is the call graph for this function: