PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ lwpoly_is_clockwise()

int lwpoly_is_clockwise ( LWPOLY poly)

Definition at line 288 of file lwpoly.c.

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 }
#define LW_FALSE
Definition: liblwgeom.h:77
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:76
int ptarray_isccw(const POINTARRAY *pa)
Definition: ptarray.c:1028
int lwpoly_is_empty(const LWPOLY *poly)
Definition: lwpoly.c:418
POINTARRAY ** rings
Definition: liblwgeom.h:460
uint32_t nrings
Definition: liblwgeom.h:458
unsigned int uint32_t
Definition: uthash.h:78

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

Referenced by lwgeom_is_clockwise().

Here is the call graph for this function:
Here is the caller graph for this function: