PostGIS  3.7.0dev-r@@SVN_REVISION@@

◆ lwpoly_force_orientation()

void lwpoly_force_orientation ( LWPOLY poly,
int  orientation 
)

Definition at line 268 of file lwpoly.c.

269 {
270  /* No-op no orientation */
271  if (orientation == LW_NONE) return;
272 
273  /* No-op empties */
274  if (lwpoly_is_empty(poly)) return;
275 
276  /* External ring */
277  if (!ptarray_has_orientation(poly->rings[0], orientation))
279 
280  /* Internal rings must run opposite to external */
281  for (uint32_t i = 1; i < poly->nrings; i++)
282  if (!ptarray_has_orientation(poly->rings[i], -1 * orientation))
284 }
void ptarray_reverse_in_place(POINTARRAY *pa)
Definition: ptarray.c:339
#define LW_NONE
int ptarray_has_orientation(const POINTARRAY *pa, int orientation)
Definition: ptarray.c:1174
int lwpoly_is_empty(const LWPOLY *poly)
POINTARRAY ** rings
Definition: liblwgeom.h:519
uint32_t nrings
Definition: liblwgeom.h:524

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

Referenced by lwgeom_force_orientation().

Here is the call graph for this function:
Here is the caller graph for this function: