PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ lwcollection_to_wkb_buf()

static uint8_t* lwcollection_to_wkb_buf ( const LWCOLLECTION col,
uint8_t buf,
uint8_t  variant 
)
static

Definition at line 621 of file lwout_wkb.c.

622 {
623  uint32_t i;
624 
625  /* Set the endian flag */
626  buf = endian_to_wkb_buf(buf, variant);
627  /* Set the geometry type */
629  /* Set the optional SRID for extended variant */
630  if ( lwgeom_wkb_needs_srid((LWGEOM*)col, variant) )
631  buf = integer_to_wkb_buf(col->srid, buf, variant);
632  /* Set the number of sub-geometries */
633  buf = integer_to_wkb_buf(col->ngeoms, buf, variant);
634 
635  /* Write the sub-geometries. Sub-geometries do not get SRIDs, they
636  inherit from their parents. */
637  for ( i = 0; i < col->ngeoms; i++ )
638  {
639  buf = lwgeom_to_wkb_buf(col->geoms[i], buf, variant | WKB_NO_SRID);
640  }
641 
642  return buf;
643 }
static uint8_t variant
Definition: cu_in_twkb.c:26
#define WKB_NO_SRID
Definition: liblwgeom.h:2073
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:164
static uint32_t lwgeom_wkb_type(const LWGEOM *geom, uint8_t variant)
Definition: lwout_wkb.c:82
static uint8_t * lwgeom_to_wkb_buf(const LWGEOM *geom, uint8_t *buf, uint8_t variant)
Definition: lwout_wkb.c:707
static uint8_t * integer_to_wkb_buf(const int ival, uint8_t *buf, uint8_t variant)
Definition: lwout_wkb.c:196
int32_t srid
Definition: liblwgeom.h:402
unsigned int uint32_t
Definition: uthash.h:78

References endian_to_wkb_buf(), LWCOLLECTION::geoms, integer_to_wkb_buf(), lwgeom_to_wkb_buf(), lwgeom_wkb_needs_srid(), lwgeom_wkb_type(), LWCOLLECTION::ngeoms, LWCOLLECTION::srid, variant, and WKB_NO_SRID.

Referenced by lwgeom_to_wkb_buf().

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