PostGIS  2.4.9dev-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.

References lwgeom_to_wkb_size(), lwgeom_wkb_needs_srid(), WKB_BYTE_SIZE, WKB_INT_SIZE, and WKB_NO_SRID.

Referenced by lwgeom_to_wkb_size().

603 {
604  /* Endian flag + type number + number of subgeoms */
605  size_t size = WKB_BYTE_SIZE + WKB_INT_SIZE + WKB_INT_SIZE;
606  int 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 int lwgeom_wkb_needs_srid(const LWGEOM *geom, uint8_t variant)
Definition: lwout_wkb.c:63
#define WKB_INT_SIZE
#define WKB_BYTE_SIZE
uint8_t variant
Definition: cu_in_twkb.c:26
static size_t lwgeom_to_wkb_size(const LWGEOM *geom, uint8_t variant)
Definition: lwout_wkb.c:648
#define WKB_NO_SRID
Definition: liblwgeom.h:2081
Here is the call graph for this function:
Here is the caller graph for this function: