PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ lwcollection_to_wkb_size()

static size_t lwcollection_to_wkb_size ( const LWCOLLECTION col,
uint8_t  variant 
)
static

Definition at line 602 of file lwout_wkb.c.

603 {
604  /* Endian flag + type number + number of subgeoms */
605  size_t size = WKB_BYTE_SIZE + WKB_INT_SIZE + WKB_INT_SIZE;
606  uint32_t i = 0;
607 
608  /* Extended WKB needs space for optional SRID integer */
609  if ( lwgeom_wkb_needs_srid((LWGEOM*)col, variant) )
610  size += WKB_INT_SIZE;
611 
612  for ( i = 0; i < col->ngeoms; i++ )
613  {
614  /* size of subgeom */
615  size += lwgeom_to_wkb_size((LWGEOM*)col->geoms[i], variant | WKB_NO_SRID);
616  }
617 
618  return size;
619 }
static uint8_t variant
Definition: cu_in_twkb.c:26
#define WKB_NO_SRID
Definition: liblwgeom.h:2073
#define WKB_BYTE_SIZE
#define WKB_INT_SIZE
static size_t lwgeom_to_wkb_size(const LWGEOM *geom, uint8_t variant)
Definition: lwout_wkb.c:648
static int lwgeom_wkb_needs_srid(const LWGEOM *geom, uint8_t variant)
Definition: lwout_wkb.c:63
unsigned int uint32_t
Definition: uthash.h:78

References LWCOLLECTION::geoms, lwgeom_to_wkb_size(), lwgeom_wkb_needs_srid(), LWCOLLECTION::ngeoms, variant, WKB_BYTE_SIZE, WKB_INT_SIZE, and WKB_NO_SRID.

Referenced by lwgeom_to_wkb_size().

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