PostGIS  2.1.10dev-r@@SVN_REVISION@@
char ptarray_same ( const POINTARRAY pa1,
const POINTARRAY pa2 
)

Definition at line 443 of file ptarray.c.

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

Referenced by lwcircstring_same(), lwline_same(), lwpoint_same(), lwpoly_same(), lwtriangle_is_repeated_points(), and lwtriangle_same().

444 {
445  uint32_t i;
446  size_t ptsize;
447 
448  if ( FLAGS_GET_ZM(pa1->flags) != FLAGS_GET_ZM(pa2->flags) ) return LW_FALSE;
449  LWDEBUG(5,"dimensions are the same");
450 
451  if ( pa1->npoints != pa2->npoints ) return LW_FALSE;
452  LWDEBUG(5,"npoints are the same");
453 
454  ptsize = ptarray_point_size(pa1);
455  LWDEBUGF(5, "ptsize = %d", ptsize);
456 
457  for (i=0; i<pa1->npoints; i++)
458  {
459  if ( memcmp(getPoint_internal(pa1, i), getPoint_internal(pa2, i), ptsize) )
460  return LW_FALSE;
461  LWDEBUGF(5,"point #%d is the same",i);
462  }
463 
464  return LW_TRUE;
465 }
int ptarray_point_size(const POINTARRAY *pa)
Definition: ptarray.c:41
int npoints
Definition: liblwgeom.h:327
#define FLAGS_GET_ZM(flags)
Definition: liblwgeom.h:119
#define LWDEBUG(level, msg)
Definition: lwgeom_log.h:50
#define LW_FALSE
Definition: liblwgeom.h:52
uint8_t flags
Definition: liblwgeom.h:325
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:51
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:55
uint8_t * getPoint_internal(const POINTARRAY *pa, int n)
Definition: ptarray.c:1645

Here is the call graph for this function:

Here is the caller graph for this function: