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

◆ cu_twkb_idlist()

static void cu_twkb_idlist ( char *  wkt,
int64_t *  idlist,
int8_t  prec_xy,
int8_t  prec_z,
int8_t  prec_m,
uint8_t  variant 
)
static

Definition at line 72 of file cu_out_twkb.c.

73{
75 LWGEOM *g_b;
76 size_t twkb_size;
77 uint8_t *twkb;
78 if ( ! g ) lwnotice("input wkt is invalid: %s", wkt);
79 twkb = lwgeom_to_twkb_with_idlist(g, idlist, variant, prec_xy, prec_z, prec_m, &twkb_size);
80 lwgeom_free(g);
81 if ( s ) free(s);
82 if ( w ) free(w);
83 s = hexbytes_from_bytes(twkb, twkb_size);
84 g_b = lwgeom_from_twkb(twkb, twkb_size, LW_PARSER_CHECK_NONE);
85 w = lwgeom_to_ewkt(g_b);
86 lwgeom_free(g_b);
87 free(twkb);
88}
static uint8_t variant
Definition cu_in_twkb.c:26
static char * w
Definition cu_out_twkb.c:25
static char * s
Definition cu_out_twkb.c:24
void lwgeom_free(LWGEOM *geom)
Definition lwgeom.c:1138
#define LW_PARSER_CHECK_NONE
Definition liblwgeom.h:2060
uint8_t * lwgeom_to_twkb_with_idlist(const LWGEOM *geom, int64_t *idlist, uint8_t variant, int8_t precision_xy, int8_t precision_z, int8_t precision_m, size_t *twkb_size)
Convert LWGEOM to a char* in TWKB format.
Definition lwout_twkb.c:589
char * hexbytes_from_bytes(const uint8_t *bytes, size_t size)
Definition lwout_wkb.c:39
char * lwgeom_to_ewkt(const LWGEOM *lwgeom)
Return an alloced string.
Definition lwgeom.c:547
LWGEOM * lwgeom_from_twkb(const uint8_t *twkb, size_t twkb_size, char check)
WKB inputs must have a declared size, to prevent malformed WKB from reading off the end of the memory...
Definition lwin_twkb.c:654
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
Definition lwin_wkt.c:905
void lwnotice(const char *fmt,...)
Write a notice out to the notice handler.
Definition lwutil.c:177
void free(void *)

References free(), hexbytes_from_bytes(), LW_PARSER_CHECK_NONE, lwgeom_free(), lwgeom_from_twkb(), lwgeom_from_wkt(), lwgeom_to_ewkt(), lwgeom_to_twkb_with_idlist(), lwnotice(), s, variant, and w.

Referenced by test_twkb_out_idlist().

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