PostGIS  2.5.0dev-r@@SVN_REVISION@@
void lwpoly_force_clockwise ( LWPOLY poly)

Definition at line 266 of file lwpoly.c.

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

Referenced by lwgeom_force_clockwise().

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