PostGIS  2.5.0beta1dev-r@@SVN_REVISION@@

◆ lwpoly_force_clockwise()

void lwpoly_force_clockwise ( LWPOLY poly)

Definition at line 268 of file lwpoly.c.

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

Referenced by lwgeom_force_clockwise().

269 {
270  uint32_t i;
271 
272  /* No-op empties */
273  if ( lwpoly_is_empty(poly) )
274  return;
275 
276  /* External ring */
277  if ( ptarray_isccw(poly->rings[0]) )
279 
280  /* Internal rings */
281  for (i=1; i<poly->nrings; i++)
282  if ( ! ptarray_isccw(poly->rings[i]) )
284 
285 }
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
POINTARRAY ** rings
Definition: liblwgeom.h:459
void ptarray_reverse_in_place(POINTARRAY *pa)
Definition: ptarray.c:341
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: