PostGIS  2.5.7dev-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 333 of file lwout_twkb.c.

334 {
335  uint32_t i;
336 
337  LWDEBUGF(2, "Entered %s", __func__);
338  LWDEBUGF(4, "Number of geometries in collection is %d", col->ngeoms);
339 
340  /* Set the number of geometries */
341  bytebuffer_append_uvarint(ts->geom_buf, (uint64_t) col->ngeoms);
342 
343  /* We've been handed an idlist, so write it in */
344  if ( ts->idlist )
345  {
346  for ( i = 0; i < col->ngeoms; i++ )
348 
349  /* Empty it out to nobody else uses it now */
350  ts->idlist = NULL;
351  }
352 
353  /* Write in the sub-geometries */
354  for ( i = 0; i < col->ngeoms; i++ )
355  {
356  lwgeom_write_to_buffer(col->geoms[i], globals, ts);
357  }
358  return 0;
359 }
void bytebuffer_append_uvarint(bytebuffer_t *b, const uint64_t val)
Writes a unsigned varInt to the buffer.
Definition: bytebuffer.c:250
void bytebuffer_append_varint(bytebuffer_t *b, const int64_t val)
Writes a signed varInt to the buffer.
Definition: bytebuffer.c:239
#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:411
uint32_t ngeoms
Definition: liblwgeom.h:510
LWGEOM ** geoms
Definition: liblwgeom.h:512
const int64_t * idlist
Definition: lwout_twkb.h:92
bytebuffer_t * geom_buf
Definition: lwout_twkb.h:89
unsigned int uint32_t
Definition: uthash.h:78

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: