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

Definition at line 246 of file lwpoly.c.

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

Referenced by lwgeom_force_clockwise().

247 {
248  int i;
249 
250  /* No-op empties */
251  if ( lwpoly_is_empty(poly) )
252  return;
253 
254  /* External ring */
255  if ( ptarray_isccw(poly->rings[0]) )
256  ptarray_reverse(poly->rings[0]);
257 
258  /* Internal rings */
259  for (i=1; i<poly->nrings; i++)
260  if ( ! ptarray_isccw(poly->rings[i]) )
261  ptarray_reverse(poly->rings[i]);
262 
263 }
int ptarray_isccw(const POINTARRAY *pa)
Definition: ptarray.c:1026
POINTARRAY ** rings
Definition: liblwgeom.h:456
int nrings
Definition: liblwgeom.h:454
void ptarray_reverse(POINTARRAY *pa)
Definition: ptarray.c:343
int lwpoly_is_empty(const LWPOLY *poly)
Definition: lwpoly.c:403

Here is the call graph for this function:

Here is the caller graph for this function: