PostGIS  2.2.8dev-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 315 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().

316 {
317  int i;
318 
319  LWDEBUGF(2, "Entered %s", __func__);
320  LWDEBUGF(4, "Number of geometries in collection is %d", col->ngeoms);
321 
322  /* Set the number of geometries */
323  bytebuffer_append_uvarint(ts->geom_buf, (uint64_t) col->ngeoms);
324 
325  /* We've been handed an idlist, so write it in */
326  if ( ts->idlist )
327  {
328  for ( i = 0; i < col->ngeoms; i++ )
330 
331  /* Empty it out to nobody else uses it now */
332  ts->idlist = NULL;
333  }
334 
335  /* Write in the sub-geometries */
336  for ( i = 0; i < col->ngeoms; i++ )
337  {
338  lwgeom_write_to_buffer(col->geoms[i], globals, ts);
339  }
340  return 0;
341 }
const int64_t * idlist
Definition: lwout_twkb.h:68
void bytebuffer_append_uvarint(bytebuffer_t *b, const uint64_t val)
Writes a unsigned varInt to the buffer.
Definition: bytebuffer.c:212
LWGEOM ** geoms
Definition: liblwgeom.h:493
static int lwgeom_write_to_buffer(const LWGEOM *geom, TWKB_GLOBALS *globals, TWKB_STATE *parent_state)
Definition: lwout_twkb.c:393
bytebuffer_t * geom_buf
Definition: lwout_twkb.h:65
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:55
void bytebuffer_append_varint(bytebuffer_t *b, const int64_t val)
Writes a signed varInt to the buffer.
Definition: bytebuffer.c:199
Here is the call graph for this function:
Here is the caller graph for this function: