PostGIS  2.2.7dev-r@@SVN_REVISION@@
static size_t lwcollection_to_wkb_size ( const LWCOLLECTION col,
uint8_t  variant 
)
static

Definition at line 588 of file lwout_wkb.c.

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

Referenced by lwgeom_to_wkb_size().

589 {
590  /* Endian flag + type number + number of subgeoms */
591  size_t size = WKB_BYTE_SIZE + WKB_INT_SIZE + WKB_INT_SIZE;
592  int i = 0;
593 
594  /* Extended WKB needs space for optional SRID integer */
595  if ( lwgeom_wkb_needs_srid((LWGEOM*)col, variant) )
596  size += WKB_INT_SIZE;
597 
598  for ( i = 0; i < col->ngeoms; i++ )
599  {
600  /* size of subgeom */
601  size += lwgeom_to_wkb_size((LWGEOM*)col->geoms[i], variant | WKB_NO_SRID);
602  }
603 
604  return size;
605 }
static int lwgeom_wkb_needs_srid(const LWGEOM *geom, uint8_t variant)
Definition: lwout_wkb.c:49
#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:634
LWGEOM ** geoms
Definition: liblwgeom.h:493
#define WKB_NO_SRID
Definition: liblwgeom.h:1937

Here is the call graph for this function:

Here is the caller graph for this function: