PostGIS  3.0.0dev-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 257 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().

258 {
259  uint32_t i;
260 
261  /* Set the number of rings */
262  bytebuffer_append_uvarint(ts->geom_buf, (uint64_t) poly->nrings);
263 
264  for ( i = 0; i < poly->nrings; i++ )
265  {
266  /* Set the coordinates (do write npoints) */
267  ptarray_to_twkb_buf(poly->rings[i], globals, ts, 1, 4);
268  }
269 
270  return 0;
271 }
uint32_t nrings
Definition: liblwgeom.h:457
unsigned int uint32_t
Definition: uthash.h:78
void bytebuffer_append_uvarint(bytebuffer_t *b, const uint64_t val)
Writes a unsigned varInt to the buffer.
Definition: bytebuffer.c:250
POINTARRAY ** rings
Definition: liblwgeom.h:459
bytebuffer_t * geom_buf
Definition: lwout_twkb.h:89
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 , controls whether an npoints entry is added to the buff...
Definition: lwout_twkb.c:106
Here is the call graph for this function:
Here is the caller graph for this function: