PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ lwpoly_is_closed()

int lwpoly_is_closed ( const LWPOLY poly)

Definition at line 499 of file lwpoly.c.

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

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: