15 #include "CUnit/Basic.h"
58 size_t twkb_size_a, twkb_size_b;
65 printf(
"ERROR: %s\n", pr.
message);
126 cu_twkb_in(
"POLYGON((0 0 0,0 1 0,1 1 0,1 0 0,0 0 0))");
129 cu_twkb_in(
"POLYGON((0 0 0 1,0 1 0 2,1 1 0 3,1 0 0 4,0 0 0 5))");
132 cu_twkb_in(
"POLYGON((0 0 0 1,0 1 0 2,1 1 0 3,1 0 0 4,0 0 0 5))");
148 cu_twkb_in(
"MULTIPOINT(0 0 0,0 1 0,1 1 0,1 0 0,0 0 1)");
151 cu_twkb_in(
"MULTIPOINT(1 2 3, 1 2 3, 4 5 6, -3 -4 -5, -10 -5 -1)");
157 cu_twkb_in(
"MULTILINESTRING((0 0,0 1),(1 1, 10 10))");
160 cu_twkb_in(
"MULTILINESTRING((0 0,0 1),EMPTY,(1 1, 10 10))");
163 cu_twkb_in(
"MULTILINESTRING((0 0 200000,0 1 10),(1 100000000 23, 10 10 45))");
173 cu_twkb_in(
"MULTIPOLYGON(((0 0 0,0 1 0,1 1 0,1 0 0,0 0 0)),((-1 -1 0,-1 2 0,2 2 0,2 -1 0,-1 -1 0),(0 0 0,0 1 0,1 1 0,1 0 0,0 0 0)))");
184 cu_twkb_in(
"GEOMETRYCOLLECTION(MULTIPOLYGON(((0 0 0,0 1 0,1 1 0,1 0 0,0 0 0))),POLYGON((0 0 0,0 1 0,1 1 0,1 0 0,0 0 0)),POINT(1 1 1),LINESTRING(0 0 0, 1 1 1))");
187 cu_twkb_in(
"GEOMETRYCOLLECTION(POLYGON((0 0 0,0 1 0,1 1 0,1 0 0,0 0 0)),POINT(1 1 1))");
193 cu_twkb_in(
"GEOMETRYCOLLECTION(POINT(1 2 3), LINESTRING EMPTY, POINT(4 5 6))");
196 cu_twkb_in(
"GEOMETRYCOLLECTION(POINT(1 2 3), POINT EMPTY, POINT(4 5 6))");
209 cu_twkb_in(
"MULTILINESTRING((0 0,0 1),EMPTY,(1 1, 10 10))");
212 cu_twkb_in(
"MULTIPOLYGON(((0 0 0,0 1 0,1 1 0,1 0 0,0 0 0)),((-1 -1 0,-1 2 0,2 2 0,2 -1 0,-1 -1 0),(0 0 0,0 1 0,1 1 0,1 0 0,0 0 0)))");
215 cu_twkb_in(
"GEOMETRYCOLLECTION(POLYGON((0 0 0,0 1 0,1 1 0,1 0 0,0 0 0)),POINT(1 1 1))");
218 cu_twkb_in(
"MULTILINESTRING((0 0 200000,0 1 10),(1 100000000 23, 10 10 45))");
static int clean_twkb_in_suite(void)
static void test_twkb_in_multipoint(void)
static void test_twkb_in_multilinestring(void)
void twkb_in_suite_setup(void)
static void test_twkb_in_multipolygon(void)
static void test_twkb_in_precision(void)
static void test_twkb_in_collection(void)
static void test_twkb_in_polygon(void)
static void test_twkb_in_linestring(void)
static void test_twkb_in_point(void)
static int init_twkb_in_suite(void)
static void cu_twkb_in(char *wkt)
#define PG_ADD_TEST(suite, testfunc)
void lwgeom_free(LWGEOM *geom)
char * hexbytes_from_bytes(const uint8_t *bytes, size_t size)
#define LW_PARSER_CHECK_NONE
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...
int lwgeom_parse_wkt(LWGEOM_PARSER_RESULT *parser_result, char *wktstr, int parse_flags)
Parse a WKT geometry string into an LWGEOM structure.
void lwgeom_parser_result_free(LWGEOM_PARSER_RESULT *parser_result)
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)
Parser result structure: returns the result of attempting to convert (E)WKT/(E)WKB to LWGEOM.