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

Definition at line 531 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().

532 {
533  /* Endian flag + type number + number of subgeoms */
534  size_t size = WKB_BYTE_SIZE + WKB_INT_SIZE + WKB_INT_SIZE;
535  int i = 0;
536 
537  /* Extended WKB needs space for optional SRID integer */
538  if ( lwgeom_wkb_needs_srid((LWGEOM*)col, variant) )
539  size += WKB_INT_SIZE;
540 
541  for ( i = 0; i < col->ngeoms; i++ )
542  {
543  /* size of subgeom */
544  size += lwgeom_to_wkb_size((LWGEOM*)col->geoms[i], variant | WKB_NO_SRID);
545  }
546 
547  return size;
548 }
static int lwgeom_wkb_needs_srid(const LWGEOM *geom, uint8_t variant)
Definition: lwout_wkb.c:47
#define WKB_INT_SIZE
#define WKB_BYTE_SIZE
static size_t lwgeom_to_wkb_size(const LWGEOM *geom, uint8_t variant)
Definition: lwout_wkb.c:577
LWGEOM ** geoms
Definition: liblwgeom.h:465
#define WKB_NO_SRID
Definition: liblwgeom.h:1774

Here is the call graph for this function:

Here is the caller graph for this function: