PostGIS  2.3.7dev-r@@SVN_REVISION@@
static int lwcollection_to_twkb_buf ( const LWCOLLECTION col,
TWKB_GLOBALS globals,
TWKB_STATE ts 
)
static

Definition at line 329 of file lwout_twkb.c.

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().

330 {
331  int i;
332 
333  LWDEBUGF(2, "Entered %s", __func__);
334  LWDEBUGF(4, "Number of geometries in collection is %d", col->ngeoms);
335 
336  /* Set the number of geometries */
337  bytebuffer_append_uvarint(ts->geom_buf, (uint64_t) col->ngeoms);
338 
339  /* We've been handed an idlist, so write it in */
340  if ( ts->idlist )
341  {
342  for ( i = 0; i < col->ngeoms; i++ )
344 
345  /* Empty it out to nobody else uses it now */
346  ts->idlist = NULL;
347  }
348 
349  /* Write in the sub-geometries */
350  for ( i = 0; i < col->ngeoms; i++ )
351  {
352  lwgeom_write_to_buffer(col->geoms[i], globals, ts);
353  }
354  return 0;
355 }
const int64_t * idlist
Definition: lwout_twkb.h:92
void bytebuffer_append_uvarint(bytebuffer_t *b, const uint64_t val)
Writes a unsigned varInt to the buffer.
Definition: bytebuffer.c:200
LWGEOM ** geoms
Definition: liblwgeom.h:508
static int lwgeom_write_to_buffer(const LWGEOM *geom, TWKB_GLOBALS *globals, TWKB_STATE *parent_state)
Definition: lwout_twkb.c:407
bytebuffer_t * geom_buf
Definition: lwout_twkb.h:89
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:88
void bytebuffer_append_varint(bytebuffer_t *b, const int64_t val)
Writes a signed varInt to the buffer.
Definition: bytebuffer.c:187

Here is the call graph for this function:

Here is the caller graph for this function: