PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ cu_wkt_in()

static char* cu_wkt_in ( char *  wkt,
uint8_t  variant 
)
static

Definition at line 50 of file cu_in_wkt.c.

51 {
53  int rv = 0;
54  char *s = 0;
55 
56  rv = lwgeom_parse_wkt(&p, wkt, 0);
57  if (p.errcode)
58  {
59  CU_ASSERT_EQUAL(rv, LW_FAILURE);
60  CU_ASSERT(!p.geom);
61  return strdup(p.message);
62  }
63  CU_ASSERT_EQUAL(rv, LW_SUCCESS);
64  s = lwgeom_to_wkt(p.geom, variant, 8, NULL);
66  return s;
67 }
static uint8_t variant
Definition: cu_in_twkb.c:26
char * s
Definition: cu_in_wkt.c:23
#define LW_FAILURE
Definition: liblwgeom.h:110
#define LW_SUCCESS
Definition: liblwgeom.h:111
int lwgeom_parse_wkt(LWGEOM_PARSER_RESULT *parser_result, char *wktstr, int parse_flags)
Parse a WKT geometry string into an LWGEOM structure.
char * lwgeom_to_wkt(const LWGEOM *geom, uint8_t variant, int precision, size_t *size_out)
WKT emitter function.
Definition: lwout_wkt.c:676
void lwgeom_parser_result_free(LWGEOM_PARSER_RESULT *parser_result)
Definition: lwin_wkt.c:886
Parser result structure: returns the result of attempting to convert (E)WKT/(E)WKB to LWGEOM.
Definition: liblwgeom.h:2068

References struct_lwgeom_parser_result::errcode, struct_lwgeom_parser_result::geom, LW_FAILURE, LW_SUCCESS, lwgeom_parse_wkt(), lwgeom_parser_result_free(), lwgeom_to_wkt(), struct_lwgeom_parser_result::message, s, and variant.

Referenced by test_wkt_in_circularstring(), test_wkt_in_collection(), test_wkt_in_compoundcurve(), test_wkt_in_curvpolygon(), test_wkt_in_linestring(), test_wkt_in_multicurve(), test_wkt_in_multilinestring(), test_wkt_in_multipoint(), test_wkt_in_multipolygon(), test_wkt_in_multisurface(), test_wkt_in_point(), test_wkt_in_polygon(), test_wkt_in_polyhedralsurface(), test_wkt_in_tin(), and test_wkt_leak().

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