PostGIS  3.0.6dev-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:108
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:107
int lwpoly_is_empty(const LWPOLY *poly)
int ptarray_isccw(const POINTARRAY *pa)
Definition: ptarray.c:1026
POINTARRAY ** rings
Definition: liblwgeom.h:505
uint32_t nrings
Definition: liblwgeom.h:510

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: