Convert LWGEOM to a char* in TWKB format.
Caller is responsible for freeing the returned array.
Definition at line 589 of file lwout_twkb.c.
595{
596 LWDEBUGF(2,
"Entered %s", __func__);
598
602
605
610
612 {
613 lwerror(
"Only collections can support ID lists");
614 return NULL;
615 }
616
617 if ( ! geom )
618 {
619 LWDEBUG(4,
"Cannot convert NULL into TWKB.");
620 lwerror(
"Cannot convert NULL into TWKB");
621 return NULL;
622 }
623
629
632 return v;
633}
void bytebuffer_destroy_buffer(bytebuffer_t *s)
Free the bytebuffer_t and all memory managed within it.
lwvarlena_t * bytebuffer_get_buffer_varlena(const bytebuffer_t *s)
Returns a copy of the internal buffer.
void bytebuffer_init_with_size(bytebuffer_t *s, size_t size)
Allocate just the internal buffer of an existing bytebuffer_t struct.
int lwgeom_is_collection(const LWGEOM *lwgeom)
Determine whether a LWGEOM contains sub-geometries or not This basically just checks that the struct ...
#define LWDEBUG(level, msg)
#define LWDEBUGF(level, msg,...)
void void lwerror(const char *fmt,...) __attribute__((format(printf
Write a notice out to the error handler.
static int lwgeom_write_to_buffer(const LWGEOM *geom, TWKB_GLOBALS *globals, TWKB_STATE *parent_state)
bytebuffer_t * header_buf
References bytebuffer_destroy_buffer(), bytebuffer_get_buffer_varlena(), bytebuffer_init_with_size(), TWKB_STATE::geom_buf, TWKB_STATE::header_buf, TWKB_STATE::idlist, LWDEBUG, LWDEBUGF, lwerror(), lwgeom_is_collection(), lwgeom_write_to_buffer(), TWKB_GLOBALS::prec_m, TWKB_GLOBALS::prec_xy, TWKB_GLOBALS::prec_z, variant, and TWKB_GLOBALS::variant.
Referenced by cu_twkb_idlist(), lwgeom_to_twkb(), and TWKBFromLWGEOMArray().