PostGIS  2.1.10dev-r@@SVN_REVISION@@
static uint8_t* lwtriangle_to_wkb_buf ( const LWTRIANGLE tri,
uint8_t *  buf,
uint8_t  variant 
)
static

Definition at line 460 of file lwout_wkb.c.

References endian_to_wkb_buf(), integer_to_wkb_buf(), lwgeom_wkb_needs_srid(), lwgeom_wkb_type(), LWTRIANGLE::points, ptarray_to_wkb_buf(), and LWTRIANGLE::srid.

Referenced by lwgeom_to_wkb_buf().

461 {
462  /* Set the endian flag */
463  buf = endian_to_wkb_buf(buf, variant);
464 
465  /* Set the geometry type */
466  buf = integer_to_wkb_buf(lwgeom_wkb_type((LWGEOM*)tri, variant), buf, variant);
467 
468  /* Set the optional SRID for extended variant */
469  if ( lwgeom_wkb_needs_srid((LWGEOM*)tri, variant) )
470  buf = integer_to_wkb_buf(tri->srid, buf, variant);
471 
472  /* Set the number of rings (only one, it's a triangle, buddy) */
473  buf = integer_to_wkb_buf(1, buf, variant);
474 
475  /* Write that ring */
476  buf = ptarray_to_wkb_buf(tri->points, buf, variant);
477 
478  return buf;
479 }
static int lwgeom_wkb_needs_srid(const LWGEOM *geom, uint8_t variant)
Definition: lwout_wkb.c:47
POINTARRAY * points
Definition: liblwgeom.h:389
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
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
int32_t srid
Definition: liblwgeom.h:388

Here is the call graph for this function:

Here is the caller graph for this function: