PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ ST_IsPolygonCCW()

Datum ST_IsPolygonCCW ( PG_FUNCTION_ARGS  )

Definition at line 1328 of file lwgeom_functions_analytic.c.

References dumpnode::geom, lwgeom_free(), lwgeom_from_gserialized(), lwgeom_is_clockwise(), and lwgeom_reverse().

Referenced by ST_IsPolygonCW().

1329 {
1330  GSERIALIZED* geom;
1331  LWGEOM* input;
1332  bool is_ccw;
1333 
1334  if (PG_ARGISNULL(0))
1335  PG_RETURN_NULL();
1336 
1337  geom = PG_GETARG_GSERIALIZED_P_COPY(0);
1338  input = lwgeom_from_gserialized(geom);
1339 
1340  lwgeom_reverse(input);
1341  is_ccw = lwgeom_is_clockwise(input);
1342 
1343  lwgeom_free(input);
1344  PG_FREE_IF_COPY(geom, 0);
1345 
1346  PG_RETURN_BOOL(is_ccw);
1347 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1099
LWGEOM * geom
void lwgeom_reverse(LWGEOM *lwgeom)
Reverse vertex order of LWGEOM.
Definition: lwgeom.c:93
int lwgeom_is_clockwise(LWGEOM *lwgeom)
Check clockwise orientation on LWGEOM polygons.
Definition: lwgeom.c:64
Here is the call graph for this function:
Here is the caller graph for this function: