PostGIS 3.7.0dev-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 460 of file lwout_wkb.c.

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

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: