PostGIS  3.0.6dev-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 273 of file lwout_twkb.c.

274 {
275  uint32_t i;
276 
277  /* Set the number of rings */
278  bytebuffer_append_uvarint(ts->geom_buf, (uint64_t) poly->nrings);
279 
280  for ( i = 0; i < poly->nrings; i++ )
281  {
282  /* Set the coordinates (do write npoints) */
283  ptarray_to_twkb_buf(poly->rings[i], globals, ts, 1, 4);
284  }
285 
286  return 0;
287 }
void bytebuffer_append_uvarint(bytebuffer_t *b, const uint64_t val)
Writes a unsigned varInt to the buffer.
Definition: bytebuffer.c:166
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:107
POINTARRAY ** rings
Definition: liblwgeom.h:505
uint32_t nrings
Definition: liblwgeom.h:510
bytebuffer_t * geom_buf
Definition: lwout_twkb.h:89

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: