PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ lwpoly_is_clockwise()

int lwpoly_is_clockwise ( LWPOLY poly)

Definition at line 290 of file lwpoly.c.

References LW_FALSE, LW_TRUE, lwpoly_is_empty(), LWPOLY::nrings, ptarray_isccw(), and LWPOLY::rings.

Referenced by lwgeom_is_clockwise().

291 {
292  int i;
293 
294  if ( lwpoly_is_empty(poly) )
295  return LW_TRUE;
296 
297  if ( ptarray_isccw(poly->rings[0]) )
298  return LW_FALSE;
299 
300  for ( i = 1; i < poly->nrings; i++)
301  if ( !ptarray_isccw(poly->rings[i]) )
302  return LW_FALSE;
303 
304  return LW_TRUE;
305 }
int ptarray_isccw(const POINTARRAY *pa)
Definition: ptarray.c:1029
#define LW_FALSE
Definition: liblwgeom.h:77
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:76
POINTARRAY ** rings
Definition: liblwgeom.h:457
int nrings
Definition: liblwgeom.h:455
int lwpoly_is_empty(const LWPOLY *poly)
Definition: lwpoly.c:445
Here is the call graph for this function:
Here is the caller graph for this function: