PostGIS  2.4.9dev-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.

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

Referenced by lwgeom_to_twkb_buf().

262 {
263  int 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:252
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:106
POINTARRAY ** rings
Definition: liblwgeom.h:457
int nrings
Definition: liblwgeom.h:455
bytebuffer_t * geom_buf
Definition: lwout_twkb.h:89
Here is the call graph for this function:
Here is the caller graph for this function: