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

◆ gserialized2_from_lwpoly_size()

static size_t gserialized2_from_lwpoly_size ( const LWPOLY poly)
static

Definition at line 715 of file gserialized2.c.

716{
717 size_t size = 4; /* Type number. */
718 uint32_t i = 0;
719
720 assert(poly);
721
722 size += 4; /* Number of rings (zero => empty). */
723 if (poly->nrings % 2)
724 size += 4; /* Padding to double alignment. */
725
726 for (i = 0; i < poly->nrings; i++)
727 {
728 size += 4; /* Number of points in ring. */
729 size += poly->rings[i]->npoints * FLAGS_NDIMS(poly->flags) * sizeof(double);
730 }
731
732 LWDEBUGF(3, "polygon size = %d", size);
733
734 return size;
735}
#define FLAGS_NDIMS(flags)
Definition liblwgeom.h:193
#define LWDEBUGF(level, msg,...)
Definition lwgeom_log.h:88
POINTARRAY ** rings
Definition liblwgeom.h:505
uint32_t nrings
Definition liblwgeom.h:510
lwflags_t flags
Definition liblwgeom.h:507
uint32_t npoints
Definition liblwgeom.h:413

References LWPOLY::flags, FLAGS_NDIMS, LWDEBUGF, POINTARRAY::npoints, LWPOLY::nrings, and LWPOLY::rings.

Referenced by gserialized2_from_any_size().

Here is the caller graph for this function: