PostGIS  2.1.10dev-r@@SVN_REVISION@@
static uint8_t* lwpoly_to_wkb_buf ( const LWPOLY poly,
uint8_t *  buf,
uint8_t  variant 
)
static

Definition at line 503 of file lwout_wkb.c.

References endian_to_wkb_buf(), integer_to_wkb_buf(), lwgeom_wkb_needs_srid(), lwgeom_wkb_type(), LWPOLY::nrings, ptarray_to_wkb_buf(), LWPOLY::rings, and LWPOLY::srid.

Referenced by lwgeom_to_wkb_buf().

504 {
505  int i;
506 
507  /* Set the endian flag */
508  buf = endian_to_wkb_buf(buf, variant);
509  /* Set the geometry type */
510  buf = integer_to_wkb_buf(lwgeom_wkb_type((LWGEOM*)poly, variant), buf, variant);
511  /* Set the optional SRID for extended variant */
512  if ( lwgeom_wkb_needs_srid((LWGEOM*)poly, variant) )
513  buf = integer_to_wkb_buf(poly->srid, buf, variant);
514  /* Set the number of rings */
515  buf = integer_to_wkb_buf(poly->nrings, buf, variant);
516 
517  for ( i = 0; i < poly->nrings; i++ )
518  {
519  buf = ptarray_to_wkb_buf(poly->rings[i], buf, variant);
520  }
521 
522  return buf;
523 }
static int lwgeom_wkb_needs_srid(const LWGEOM *geom, uint8_t variant)
Definition: lwout_wkb.c:47
static uint32_t lwgeom_wkb_type(const LWGEOM *geom, uint8_t variant)
Definition: lwout_wkb.c:66
static uint8_t * integer_to_wkb_buf(const int ival, uint8_t *buf, uint8_t variant)
Definition: lwout_wkb.c:180
POINTARRAY ** rings
Definition: liblwgeom.h:413
int nrings
Definition: liblwgeom.h:411
int32_t srid
Definition: liblwgeom.h:410
static uint8_t * ptarray_to_wkb_buf(const POINTARRAY *pa, uint8_t *buf, uint8_t variant)
Definition: lwout_wkb.c:332
static uint8_t * endian_to_wkb_buf(uint8_t *buf, uint8_t variant)
Definition: lwout_wkb.c:148

Here is the call graph for this function:

Here is the caller graph for this function: