PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ lwpoly_to_wkb_buf()

static uint8_t* lwpoly_to_wkb_buf ( const LWPOLY poly,
uint8_t *  buf,
uint8_t  variant 
)
static

Definition at line 596 of file lwout_wkb.c.

597 {
598  uint32_t i;
599 
600  /* Only process empty at this level in the EXTENDED case */
601  if ( (variant & WKB_EXTENDED) && lwgeom_is_empty((LWGEOM*)poly) )
602  return empty_to_wkb_buf((LWGEOM*)poly, buf, variant);
603 
604  /* Set the endian flag */
605  buf = endian_to_wkb_buf(buf, variant);
606  /* Set the geometry type */
608  /* Set the optional SRID for extended variant */
609  if ( lwgeom_wkb_needs_srid((LWGEOM*)poly, variant) )
610  buf = integer_to_wkb_buf(poly->srid, buf, variant);
611  /* Set the number of rings */
612  buf = integer_to_wkb_buf(poly->nrings, buf, variant);
613 
614  for ( i = 0; i < poly->nrings; i++ )
615  {
616  buf = ptarray_to_wkb_buf(poly->rings[i], buf, variant);
617  }
618 
619  return buf;
620 }
static uint8_t variant
Definition: cu_in_twkb.c:26
#define WKB_EXTENDED
Definition: liblwgeom.h:2123
static int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members)
Definition: lwinline.h:193
static uint8_t * ptarray_to_wkb_buf(const POINTARRAY *pa, uint8_t *buf, uint8_t variant)
Definition: lwout_wkb.c:397
static int lwgeom_wkb_needs_srid(const LWGEOM *geom, uint8_t variant)
Definition: lwout_wkb.c:63
static uint8_t * endian_to_wkb_buf(uint8_t *buf, uint8_t variant)
Definition: lwout_wkb.c:163
static uint32_t lwgeom_wkb_type(const LWGEOM *geom, uint8_t variant)
Definition: lwout_wkb.c:82
static uint8_t * empty_to_wkb_buf(const LWGEOM *geom, uint8_t *buf, uint8_t variant)
Definition: lwout_wkb.c:343
static uint8_t * integer_to_wkb_buf(const uint32_t ival, uint8_t *buf, uint8_t variant)
Definition: lwout_wkb.c:196
int32_t srid
Definition: liblwgeom.h:446

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

Referenced by lwgeom_to_wkb_buf().

Here is the call graph for this function:
Here is the caller graph for this function: