PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ ptarray_same2d()

char ptarray_same2d ( const POINTARRAY pa1,
const POINTARRAY pa2 
)

Definition at line 501 of file ptarray.c.

502 {
503  uint32_t i;
504 
505  if ( FLAGS_GET_ZM(pa1->flags) != FLAGS_GET_ZM(pa2->flags) ) return LW_FALSE;
506  LWDEBUG(5,"dimensions are the same");
507 
508  if ( pa1->npoints != pa2->npoints ) return LW_FALSE;
509  LWDEBUG(5,"npoints are the same");
510 
511  for (i=0; i<pa1->npoints; i++)
512  {
513  if ( memcmp(getPoint_internal(pa1, i), getPoint_internal(pa2, i), sizeof(POINT2D)) )
514  return LW_FALSE;
515  LWDEBUGF(5,"point #%d is the same",i);
516  }
517 
518  return LW_TRUE;
519 }
#define LW_FALSE
Definition: liblwgeom.h:94
#define FLAGS_GET_ZM(flags)
Definition: liblwgeom.h:180
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:93
#define LWDEBUG(level, msg)
Definition: lwgeom_log.h:83
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:88
static uint8_t * getPoint_internal(const POINTARRAY *pa, uint32_t n)
Definition: lwinline.h:77
lwflags_t flags
Definition: liblwgeom.h:431
uint32_t npoints
Definition: liblwgeom.h:427

References POINTARRAY::flags, FLAGS_GET_ZM, getPoint_internal(), LW_FALSE, LW_TRUE, LWDEBUG, LWDEBUGF, and POINTARRAY::npoints.

Referenced by lwpoint_same2d().

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