PostGIS  2.5.0dev-r@@SVN_REVISION@@

◆ lwpoly_is_clockwise()

int lwpoly_is_clockwise ( LWPOLY poly)

Definition at line 288 of file lwpoly.c.

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

Referenced by lwgeom_is_clockwise().

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