PostGIS 3.0.6dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ lwpoint_to_wkb_buf()

static uint8_t * lwpoint_to_wkb_buf ( const LWPOINT pt,
uint8_t *  buf,
uint8_t  variant 
)
static

Definition at line 459 of file lwout_wkb.c.

460{
461 /* Only process empty at this level in the EXTENDED case */
462 if ( (variant & WKB_EXTENDED) && lwgeom_is_empty((LWGEOM*)pt) )
463 return empty_to_wkb_buf((LWGEOM*)pt, buf, variant);
464
465 /* Set the endian flag */
466 LWDEBUGF(4, "Entering function, buf = %p", buf);
467 buf = endian_to_wkb_buf(buf, variant);
468 LWDEBUGF(4, "Endian set, buf = %p", buf);
469 /* Set the geometry type */
471 LWDEBUGF(4, "Type set, buf = %p", buf);
472 /* Set the optional SRID for extended variant */
474 {
475 buf = integer_to_wkb_buf(pt->srid, buf, variant);
476 LWDEBUGF(4, "SRID set, buf = %p", buf);
477 }
478 /* Set the coordinates */
479 buf = ptarray_to_wkb_buf(pt->point, buf, variant | WKB_NO_NPOINTS);
480 LWDEBUGF(4, "Pointarray set, buf = %p", buf);
481 return buf;
482}
static uint8_t variant
Definition cu_in_twkb.c:26
#define WKB_NO_NPOINTS
Definition liblwgeom.h:2127
#define WKB_EXTENDED
Definition liblwgeom.h:2123
#define LWDEBUGF(level, msg,...)
Definition lwgeom_log.h:88
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 * integer_to_wkb_buf(const uint32_t ival, uint8_t *buf, uint8_t variant)
Definition lwout_wkb.c:196
static int lwgeom_wkb_needs_srid(const LWGEOM *geom, uint8_t variant)
Definition lwout_wkb.c:63
static uint8_t * ptarray_to_wkb_buf(const POINTARRAY *pa, uint8_t *buf, uint8_t variant)
Definition lwout_wkb.c:397
static uint32_t lwgeom_wkb_type(const LWGEOM *geom, uint8_t variant)
Definition lwout_wkb.c:82
static uint8_t * endian_to_wkb_buf(uint8_t *buf, uint8_t variant)
Definition lwout_wkb.c:163
static uint8_t * empty_to_wkb_buf(const LWGEOM *geom, uint8_t *buf, uint8_t variant)
Definition lwout_wkb.c:343
int32_t srid
Definition liblwgeom.h:446

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, variant, WKB_EXTENDED, and WKB_NO_NPOINTS.

Referenced by lwgeom_to_wkb_buf().

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