PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ 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.

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, and w.

Referenced by test_twkb_out_idlist().

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 }
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:568
uint8_t variant
Definition: cu_in_twkb.c:26
void lwnotice(const char *fmt,...)
Write a notice out to the notice handler.
Definition: lwutil.c:177
char * s
Definition: cu_out_twkb.c:24
char * lwgeom_to_ewkt(const LWGEOM *lwgeom)
Return an alloced string.
Definition: lwgeom.c:518
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1099
char * w
Definition: cu_out_twkb.c:25
char * hexbytes_from_bytes(uint8_t *bytes, size_t size)
Definition: lwout_wkb.c:39
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
Definition: lwin_wkt.c:904
#define LW_PARSER_CHECK_NONE
Definition: liblwgeom.h:2013
LWGEOM * lwgeom_from_twkb(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:656
void free(void *)
unsigned char uint8_t
Definition: uthash.h:79
Here is the call graph for this function:
Here is the caller graph for this function: