PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ lwline_to_wkb_buf()

static uint8_t* lwline_to_wkb_buf ( const LWLINE line,
uint8_t buf,
uint8_t  variant 
)
static

Definition at line 479 of file lwout_wkb.c.

480 {
481  /* Only process empty at this level in the EXTENDED case */
482  if ( (variant & WKB_EXTENDED) && lwgeom_is_empty((LWGEOM*)line) )
483  return empty_to_wkb_buf((LWGEOM*)line, buf, variant);
484 
485  /* Set the endian flag */
486  buf = endian_to_wkb_buf(buf, variant);
487  /* Set the geometry type */
489  /* Set the optional SRID for extended variant */
490  if ( lwgeom_wkb_needs_srid((LWGEOM*)line, variant) )
491  buf = integer_to_wkb_buf(line->srid, buf, variant);
492  /* Set the coordinates */
493  buf = ptarray_to_wkb_buf(line->points, buf, variant);
494  return buf;
495 }
static uint8_t variant
Definition: cu_in_twkb.c:26
#define WKB_EXTENDED
Definition: liblwgeom.h:2068
int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members)
Definition: lwgeom.c:1393
static uint8_t * ptarray_to_wkb_buf(const POINTARRAY *pa, uint8_t *buf, uint8_t variant)
Definition: lwout_wkb.c:371
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 * empty_to_wkb_buf(const LWGEOM *geom, uint8_t *buf, uint8_t variant)
Definition: lwout_wkb.c:315
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

References empty_to_wkb_buf(), endian_to_wkb_buf(), integer_to_wkb_buf(), lwgeom_is_empty(), lwgeom_wkb_needs_srid(), lwgeom_wkb_type(), LWLINE::points, ptarray_to_wkb_buf(), LWLINE::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: