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 void test_twkb_in_point(void)
static void test_twkb_in_multipolygon(void)
void lwgeom_free(LWGEOM *geom)
void lwgeom_parser_result_free(LWGEOM_PARSER_RESULT *parser_result)
static void test_twkb_in_precision(void)
char * hexbytes_from_bytes(uint8_t *bytes, size_t size)
static int clean_twkb_in_suite(void)
#define LW_PARSER_CHECK_NONE
static void test_twkb_in_multilinestring(void)
int lwgeom_parse_wkt(LWGEOM_PARSER_RESULT *parser_result, char *wktstr, int parse_flags)
Parse a WKT geometry string into an LWGEOM structure.
Parser result structure: returns the result of attempting to convert (E)WKT/(E)WKB to LWGEOM...
#define PG_ADD_TEST(suite, testfunc)
static void test_twkb_in_multipoint(void)
static int init_twkb_in_suite(void)
static void cu_twkb_in(char *wkt)
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...
static void test_twkb_in_linestring(void)
static void test_twkb_in_collection(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)
void twkb_in_suite_setup(void)
static void test_twkb_in_polygon(void)