PostGIS  3.7.0dev-r@@SVN_REVISION@@

◆ ST_IsPolygonCCW()

Datum ST_IsPolygonCCW ( PG_FUNCTION_ARGS  )

Definition at line 896 of file lwgeom_functions_analytic.c.

897 {
898  GSERIALIZED* geom;
899  LWGEOM* input;
900  bool is_ccw;
901 
902  if (PG_ARGISNULL(0))
903  PG_RETURN_NULL();
904 
905  geom = PG_GETARG_GSERIALIZED_P_COPY(0);
906  input = lwgeom_from_gserialized(geom);
908  is_ccw = lwgeom_is_clockwise(input);
909  lwgeom_free(input);
910  PG_FREE_IF_COPY(geom, 0);
911 
912  PG_RETURN_BOOL(is_ccw);
913 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
Definition: gserialized.c:268
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1218
int lwgeom_is_clockwise(LWGEOM *lwgeom)
Ensure the outer ring is clockwise oriented and all inner rings are counter-clockwise.
Definition: lwgeom.c:66
void lwgeom_reverse_in_place(LWGEOM *lwgeom)
Reverse vertex order of LWGEOM.
Definition: lwgeom.c:103

References lwgeom_free(), lwgeom_from_gserialized(), lwgeom_is_clockwise(), and lwgeom_reverse_in_place().

Here is the call graph for this function: