PostGIS  2.5.0dev-r@@SVN_REVISION@@
int lwpoly_is_clockwise ( LWPOLY poly)

Definition at line 286 of file lwpoly.c.

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

Referenced by lwgeom_is_clockwise().

287 {
288  uint32_t i;
289 
290  if ( lwpoly_is_empty(poly) )
291  return LW_TRUE;
292 
293  if ( ptarray_isccw(poly->rings[0]) )
294  return LW_FALSE;
295 
296  for ( i = 1; i < poly->nrings; i++)
297  if ( !ptarray_isccw(poly->rings[i]) )
298  return LW_FALSE;
299 
300  return LW_TRUE;
301 }
int ptarray_isccw(const POINTARRAY *pa)
Definition: ptarray.c:1021
uint32_t nrings
Definition: liblwgeom.h:454
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:456
int lwpoly_is_empty(const LWPOLY *poly)
Definition: lwpoly.c:416

Here is the call graph for this function:

Here is the caller graph for this function: