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

◆ cu_twkb()

static void cu_twkb ( char *  wkt,
int8_t  prec_xy,
int8_t  prec_z,
int8_t  prec_m,
uint8_t  variant 
)
static

Definition at line 55 of file cu_out_twkb.c.

56{
58 if ( ! g ) lwnotice("input wkt is invalid: %s", wkt);
59 lwvarlena_t *twkb = lwgeom_to_twkb(g, variant, prec_xy, prec_z, prec_m);
60 lwgeom_free(g);
61 if ( s ) free(s);
62 s = hexbytes_from_bytes((uint8_t *)twkb->data, LWSIZE_GET(twkb->size) - LWVARHDRSZ);
63 free(twkb);
64}
static uint8_t variant
Definition cu_in_twkb.c:26
static char * s
Definition cu_out_twkb.c:24
#define LWVARHDRSZ
Definition liblwgeom.h:311
void lwgeom_free(LWGEOM *geom)
Definition lwgeom.c:1246
#define LW_PARSER_CHECK_NONE
Definition liblwgeom.h:2149
#define LWSIZE_GET(varsize)
Macro for reading the size from the GSERIALIZED size attribute.
Definition liblwgeom.h:324
char * hexbytes_from_bytes(const uint8_t *bytes, size_t size)
Definition lwout_wkb.c:40
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
Definition lwin_wkt.c:940
lwvarlena_t * lwgeom_to_twkb(const LWGEOM *geom, uint8_t variant, int8_t precision_xy, int8_t precision_z, int8_t precision_m)
Definition lwout_twkb.c:636
void lwnotice(const char *fmt,...) __attribute__((format(printf
Write a notice out to the notice handler.
void free(void *)
uint32_t size
Definition liblwgeom.h:307
char data[]
Definition liblwgeom.h:308

References lwvarlena_t::data, free(), hexbytes_from_bytes(), LW_PARSER_CHECK_NONE, lwgeom_free(), lwgeom_from_wkt(), lwgeom_to_twkb(), lwnotice(), LWSIZE_GET, LWVARHDRSZ, s, lwvarlena_t::size, and variant.

Referenced by test_twkb_out_collection(), test_twkb_out_linestring(), test_twkb_out_multipoint(), test_twkb_out_multipolygon(), test_twkb_out_point(), and test_twkb_out_polygon().

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