PostGIS  2.2.7dev-r@@SVN_REVISION@@
static uint8_t* lwpoint_to_wkb_buf ( const LWPOINT pt,
uint8_t *  buf,
uint8_t  variant 
)
static

Definition at line 419 of file lwout_wkb.c.

References empty_to_wkb_buf(), endian_to_wkb_buf(), integer_to_wkb_buf(), LWDEBUGF, lwgeom_is_empty(), lwgeom_wkb_needs_srid(), lwgeom_wkb_type(), LWPOINT::point, ptarray_to_wkb_buf(), LWPOINT::srid, WKB_EXTENDED, and WKB_NO_NPOINTS.

Referenced by lwgeom_to_wkb_buf().

420 {
421  /* Only process empty at this level in the EXTENDED case */
422  if ( (variant & WKB_EXTENDED) && lwgeom_is_empty((LWGEOM*)pt) )
423  return empty_to_wkb_buf((LWGEOM*)pt, buf, variant);
424 
425  /* Set the endian flag */
426  LWDEBUGF(4, "Entering function, buf = %p", buf);
427  buf = endian_to_wkb_buf(buf, variant);
428  LWDEBUGF(4, "Endian set, buf = %p", buf);
429  /* Set the geometry type */
431  LWDEBUGF(4, "Type set, buf = %p", buf);
432  /* Set the optional SRID for extended variant */
433  if ( lwgeom_wkb_needs_srid((LWGEOM*)pt, variant) )
434  {
435  buf = integer_to_wkb_buf(pt->srid, buf, variant);
436  LWDEBUGF(4, "SRID set, buf = %p", buf);
437  }
438  /* Set the coordinates */
439  buf = ptarray_to_wkb_buf(pt->point, buf, variant | WKB_NO_NPOINTS);
440  LWDEBUGF(4, "Pointarray set, buf = %p", buf);
441  return buf;
442 }
static uint8_t * empty_to_wkb_buf(const LWGEOM *geom, uint8_t *buf, uint8_t variant)
Definition: lwout_wkb.c:301
static int lwgeom_wkb_needs_srid(const LWGEOM *geom, uint8_t variant)
Definition: lwout_wkb.c:49
uint8_t variant
Definition: cu_in_twkb.c:26
static uint32_t lwgeom_wkb_type(const LWGEOM *geom, uint8_t variant)
Definition: lwout_wkb.c:68
POINTARRAY * point
Definition: liblwgeom.h:395
static uint8_t * integer_to_wkb_buf(const int ival, uint8_t *buf, uint8_t variant)
Definition: lwout_wkb.c:182
#define WKB_EXTENDED
Definition: liblwgeom.h:1932
int32_t srid
Definition: liblwgeom.h:394
static uint8_t * ptarray_to_wkb_buf(const POINTARRAY *pa, uint8_t *buf, uint8_t variant)
Definition: lwout_wkb.c:357
#define WKB_NO_NPOINTS
Definition: liblwgeom.h:1936
static uint8_t * endian_to_wkb_buf(uint8_t *buf, uint8_t variant)
Definition: lwout_wkb.c:150
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:1297
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:55

Here is the call graph for this function:

Here is the caller graph for this function: