PostGIS  2.2.8dev-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 243 of file lwout_twkb.c.

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

Referenced by lwgeom_to_twkb_buf().

244 {
245  int i;
246 
247  /* Set the number of rings */
248  bytebuffer_append_uvarint(ts->geom_buf, (uint64_t) poly->nrings);
249 
250  for ( i = 0; i < poly->nrings; i++ )
251  {
252  /* Set the coordinates (do write npoints) */
253  ptarray_to_twkb_buf(poly->rings[i], globals, ts, 1, 4);
254  }
255 
256  return 0;
257 }
void bytebuffer_append_uvarint(bytebuffer_t *b, const uint64_t val)
Writes a unsigned varInt to the buffer.
Definition: bytebuffer.c:212
static int ptarray_to_twkb_buf(const POINTARRAY *pa, TWKB_GLOBALS *globals, TWKB_STATE *ts, int register_npoints, int minpoints)
Stores a pointarray as varints in the buffer , controls whether an npoints entry is added to the buff...
Definition: lwout_twkb.c:92
POINTARRAY ** rings
Definition: liblwgeom.h:441
int nrings
Definition: liblwgeom.h:439
bytebuffer_t * geom_buf
Definition: lwout_twkb.h:65
Here is the call graph for this function:
Here is the caller graph for this function: