PostGIS  3.0.0dev-r@@SVN_REVISION@@

◆ LWGEOM_force_clockwise_poly()

Datum LWGEOM_force_clockwise_poly ( PG_FUNCTION_ARGS  )

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

1900 {
1901  GSERIALIZED *ingeom, *outgeom;
1902  LWGEOM *lwgeom;
1903 
1904  POSTGIS_DEBUG(2, "LWGEOM_force_clockwise_poly called");
1905 
1906  ingeom = PG_GETARG_GSERIALIZED_P_COPY(0);
1907 
1908  lwgeom = lwgeom_from_gserialized(ingeom);
1909  lwgeom_force_clockwise(lwgeom);
1910 
1911  outgeom = geometry_serialize(lwgeom);
1912 
1913  lwgeom_free(lwgeom);
1914  PG_FREE_IF_COPY(ingeom, 0);
1915  PG_RETURN_POINTER(outgeom);
1916 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1128
void lwgeom_force_clockwise(LWGEOM *lwgeom)
Force Right-hand-rule on LWGEOM polygons.
Definition: lwgeom.c:37
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)
Here is the call graph for this function:
Here is the caller graph for this function: