PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ LWGEOM_force_clockwise_poly()

Datum LWGEOM_force_clockwise_poly ( PG_FUNCTION_ARGS  )

Definition at line 1860 of file lwgeom_functions_basic.c.

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

Referenced by LWGEOM_reverse().

1861 {
1862  GSERIALIZED *ingeom, *outgeom;
1863  LWGEOM *lwgeom;
1864 
1865  POSTGIS_DEBUG(2, "LWGEOM_force_clockwise_poly called");
1866 
1867  ingeom = PG_GETARG_GSERIALIZED_P_COPY(0);
1868 
1869  lwgeom = lwgeom_from_gserialized(ingeom);
1870  lwgeom_force_clockwise(lwgeom);
1871 
1872  outgeom = geometry_serialize(lwgeom);
1873 
1874  lwgeom_free(lwgeom);
1875  PG_FREE_IF_COPY(ingeom, 0);
1876  PG_RETURN_POINTER(outgeom);
1877 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1050
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:
Here is the caller graph for this function: