PostGIS  3.7.0dev-r@@SVN_REVISION@@

◆ ptarray_same2d()

char ptarray_same2d ( const POINTARRAY pa1,
const POINTARRAY pa2 
)

Definition at line 509 of file ptarray.c.

510 {
511  uint32_t i;
512 
513  if ( FLAGS_GET_ZM(pa1->flags) != FLAGS_GET_ZM(pa2->flags) ) return LW_FALSE;
514  LWDEBUG(5,"dimensions are the same");
515 
516  if ( pa1->npoints != pa2->npoints ) return LW_FALSE;
517  LWDEBUG(5,"npoints are the same");
518 
519  for (i=0; i<pa1->npoints; i++)
520  {
521  if ( memcmp(getPoint_internal(pa1, i), getPoint_internal(pa2, i), sizeof(POINT2D)) )
522  return LW_FALSE;
523  LWDEBUGF(5,"point #%d is the same",i);
524  }
525 
526  return LW_TRUE;
527 }
#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:101
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:106
static uint8_t * getPoint_internal(const POINTARRAY *pa, uint32_t n)
Definition: lwinline.h:75
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: