PostGIS  3.7.0dev-r@@SVN_REVISION@@

◆ lwpoly_is_closed()

int lwpoly_is_closed ( const LWPOLY poly)

Definition at line 498 of file lwpoly.c.

499 {
500  uint32_t i = 0;
501 
502  if ( poly->nrings == 0 )
503  return LW_TRUE;
504 
505  for ( i = 0; i < poly->nrings; i++ )
506  {
507  if (FLAGS_GET_Z(poly->flags))
508  {
509  if ( ! ptarray_is_closed_3d(poly->rings[i]) )
510  return LW_FALSE;
511  }
512  else
513  {
514  if ( ! ptarray_is_closed_2d(poly->rings[i]) )
515  return LW_FALSE;
516  }
517  }
518 
519  return LW_TRUE;
520 }
#define LW_FALSE
Definition: liblwgeom.h:94
int ptarray_is_closed_3d(const POINTARRAY *pa)
Definition: ptarray.c:723
#define FLAGS_GET_Z(flags)
Definition: liblwgeom.h:165
int ptarray_is_closed_2d(const POINTARRAY *pa)
Definition: ptarray.c:710
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:93
POINTARRAY ** rings
Definition: liblwgeom.h:519
uint32_t nrings
Definition: liblwgeom.h:524
lwflags_t flags
Definition: liblwgeom.h:521

References LWPOLY::flags, FLAGS_GET_Z, LW_FALSE, LW_TRUE, LWPOLY::nrings, ptarray_is_closed_2d(), ptarray_is_closed_3d(), and LWPOLY::rings.

Referenced by lwgeom_is_closed().

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