PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ lwpoly_to_twkb_buf()

static int lwpoly_to_twkb_buf ( const LWPOLY poly,
TWKB_GLOBALS globals,
TWKB_STATE ts 
)
static

Definition at line 261 of file lwout_twkb.c.

262 {
263  uint32_t i;
264 
265  /* Set the number of rings */
266  bytebuffer_append_uvarint(ts->geom_buf, (uint64_t) poly->nrings);
267 
268  for ( i = 0; i < poly->nrings; i++ )
269  {
270  /* Set the coordinates (do write npoints) */
271  ptarray_to_twkb_buf(poly->rings[i], globals, ts, 1, 4);
272  }
273 
274  return 0;
275 }
void bytebuffer_append_uvarint(bytebuffer_t *b, const uint64_t val)
Writes a unsigned varInt to the buffer.
Definition: bytebuffer.c:250
static int ptarray_to_twkb_buf(const POINTARRAY *pa, TWKB_GLOBALS *globals, TWKB_STATE *ts, int register_npoints, uint32_t minpoints)
Stores a pointarray as varints in the buffer @register_npoints, controls whether an npoints entry is ...
Definition: lwout_twkb.c:106
POINTARRAY ** rings
Definition: liblwgeom.h:460
uint32_t nrings
Definition: liblwgeom.h:458
bytebuffer_t * geom_buf
Definition: lwout_twkb.h:89
unsigned int uint32_t
Definition: uthash.h:78

References bytebuffer_append_uvarint(), TWKB_STATE::geom_buf, LWPOLY::nrings, ptarray_to_twkb_buf(), and LWPOLY::rings.

Referenced by lwgeom_to_twkb_buf().

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