PostGIS  3.7.0dev-r@@SVN_REVISION@@

◆ lwpoly_has_orientation()

int lwpoly_has_orientation ( const LWPOLY poly,
int  orientation 
)

Definition at line 287 of file lwpoly.c.

288 {
289  if (lwpoly_is_empty(poly))
290  return LW_TRUE;
291 
292  /* Exterior ring matches orientation? */
293  if(!ptarray_has_orientation(poly->rings[0], orientation))
294  return LW_FALSE;
295 
296  /* Interior rings are opposite of orientation? */
297  for (uint32_t i = 1; i < poly->nrings; i++)
298  if (!ptarray_has_orientation(poly->rings[i], -1 * orientation))
299  return LW_FALSE;
300 
301  return LW_TRUE;
302 }
#define LW_FALSE
Definition: liblwgeom.h:94
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:93
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_FALSE, LW_TRUE, lwpoly_is_empty(), LWPOLY::nrings, ptarray_has_orientation(), and LWPOLY::rings.

Referenced by lwgeom_has_orientation().

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