PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ ptarray_same()

char ptarray_same ( const POINTARRAY pa1,
const POINTARRAY pa2 
)

Definition at line 484 of file ptarray.c.

485{
486 uint32_t i;
487 size_t ptsize;
488
489 if ( FLAGS_GET_ZM(pa1->flags) != FLAGS_GET_ZM(pa2->flags) ) return LW_FALSE;
490 LWDEBUG(5,"dimensions are the same");
491
492 if ( pa1->npoints != pa2->npoints ) return LW_FALSE;
493 LWDEBUG(5,"npoints are the same");
494
495 ptsize = ptarray_point_size(pa1);
496 LWDEBUGF(5, "ptsize = %zu", ptsize);
497
498 for (i=0; i<pa1->npoints; i++)
499 {
500 if ( memcmp(getPoint_internal(pa1, i), getPoint_internal(pa2, i), ptsize) )
501 return LW_FALSE;
502 LWDEBUGF(5,"point #%d is the same",i);
503 }
504
505 return LW_TRUE;
506}
#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
static size_t ptarray_point_size(const POINTARRAY *pa)
Definition lwinline.h:56
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, POINTARRAY::npoints, and ptarray_point_size().

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

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