PostGIS  2.3.7dev-r@@SVN_REVISION@@

◆ cu_twkb()

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

Definition at line 55 of file cu_out_twkb.c.

References free(), hexbytes_from_bytes(), LW_PARSER_CHECK_NONE, lwgeom_free(), lwgeom_from_wkt(), lwgeom_to_twkb(), lwnotice(), and s.

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().

56 {
58  size_t twkb_size;
59  uint8_t *twkb;
60  if ( ! g ) lwnotice("input wkt is invalid: %s", wkt);
61  twkb = lwgeom_to_twkb(g, variant, prec_xy, prec_z, prec_m, &twkb_size);
62  lwgeom_free(g);
63  if ( s ) free(s);
64  s = hexbytes_from_bytes(twkb, twkb_size);
65  free(twkb);
66 }
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:89
char * s
Definition: cu_out_twkb.c:24
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1063
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
Definition: liblwgeom.h:1985
void free(void *)
uint8_t * lwgeom_to_twkb(const LWGEOM *geom, uint8_t variant, int8_t precision_xy, int8_t precision_z, int8_t precision_m, size_t *twkb_size)
Definition: lwout_twkb.c:608
Here is the call graph for this function:
Here is the caller graph for this function: