PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ lwcollection_to_twkb_buf()

static int lwcollection_to_twkb_buf ( const LWCOLLECTION col,
TWKB_GLOBALS globals,
TWKB_STATE ts 
)
static

Definition at line 345 of file lwout_twkb.c.

346 {
347  uint32_t i;
348 
349  LWDEBUGF(2, "Entered %s", __func__);
350  LWDEBUGF(4, "Number of geometries in collection is %d", col->ngeoms);
351 
352  /* Set the number of geometries */
353  bytebuffer_append_uvarint(ts->geom_buf, (uint64_t) col->ngeoms);
354 
355  /* We've been handed an idlist, so write it in */
356  if ( ts->idlist )
357  {
358  for ( i = 0; i < col->ngeoms; i++ )
360 
361  /* Empty it out to nobody else uses it now */
362  ts->idlist = NULL;
363  }
364 
365  /* Write in the sub-geometries */
366  for ( i = 0; i < col->ngeoms; i++ )
367  {
368  lwgeom_write_to_buffer(col->geoms[i], globals, ts);
369  }
370  return 0;
371 }
void bytebuffer_append_uvarint(bytebuffer_t *b, const uint64_t val)
Writes a unsigned varInt to the buffer.
Definition: bytebuffer.c:166
void bytebuffer_append_varint(bytebuffer_t *b, const int64_t val)
Writes a signed varInt to the buffer.
Definition: bytebuffer.c:155
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:88
static int lwgeom_write_to_buffer(const LWGEOM *geom, TWKB_GLOBALS *globals, TWKB_STATE *parent_state)
Definition: lwout_twkb.c:429
uint32_t ngeoms
Definition: liblwgeom.h:566
LWGEOM ** geoms
Definition: liblwgeom.h:561
const int64_t * idlist
Definition: lwout_twkb.h:92
bytebuffer_t * geom_buf
Definition: lwout_twkb.h:89

References bytebuffer_append_uvarint(), bytebuffer_append_varint(), TWKB_STATE::geom_buf, LWCOLLECTION::geoms, TWKB_STATE::idlist, LWDEBUGF, lwgeom_write_to_buffer(), and LWCOLLECTION::ngeoms.

Referenced by lwgeom_to_twkb_buf().

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