15 #include "CUnit/Basic.h"
63 printf(
"ERROR: %s\n", pr.
message);
124 cu_twkb_in(
"POLYGON((0 0 0,0 1 0,1 1 0,1 0 0,0 0 0))");
127 cu_twkb_in(
"POLYGON((0 0 0 1,0 1 0 2,1 1 0 3,1 0 0 4,0 0 0 5))");
130 cu_twkb_in(
"POLYGON((0 0 0 1,0 1 0 2,1 1 0 3,1 0 0 4,0 0 0 5))");
146 cu_twkb_in(
"MULTIPOINT(0 0 0,0 1 0,1 1 0,1 0 0,0 0 1)");
149 cu_twkb_in(
"MULTIPOINT(1 2 3, 1 2 3, 4 5 6, -3 -4 -5, -10 -5 -1)");
155 cu_twkb_in(
"MULTILINESTRING((0 0,0 1),(1 1, 10 10))");
158 cu_twkb_in(
"MULTILINESTRING((0 0,0 1),EMPTY,(1 1, 10 10))");
161 cu_twkb_in(
"MULTILINESTRING((0 0 200000,0 1 10),(1 100000000 23, 10 10 45))");
171 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)))");
182 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))");
185 cu_twkb_in(
"GEOMETRYCOLLECTION(POLYGON((0 0 0,0 1 0,1 1 0,1 0 0,0 0 0)),POINT(1 1 1))");
191 cu_twkb_in(
"GEOMETRYCOLLECTION(POINT(1 2 3), LINESTRING EMPTY, POINT(4 5 6))");
194 cu_twkb_in(
"GEOMETRYCOLLECTION(POINT(1 2 3), POINT EMPTY, POINT(4 5 6))");
207 cu_twkb_in(
"MULTILINESTRING((0 0,0 1),EMPTY,(1 1, 10 10))");
210 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)))");
213 cu_twkb_in(
"GEOMETRYCOLLECTION(POLYGON((0 0 0,0 1 0,1 1 0,1 0 0,0 0 0)),POINT(1 1 1))");
216 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...
#define LWSIZE_GET(varsize)
Macro for reading the size from the GSERIALIZED size attribute.
int lwgeom_parse_wkt(LWGEOM_PARSER_RESULT *parser_result, char *wktstr, int parse_flags)
Parse a WKT geometry string into an LWGEOM structure.
lwvarlena_t * lwgeom_to_twkb(const LWGEOM *geom, uint8_t variant, int8_t precision_xy, int8_t precision_z, int8_t precision_m)
void lwgeom_parser_result_free(LWGEOM_PARSER_RESULT *parser_result)
Parser result structure: returns the result of attempting to convert (E)WKT/(E)WKB to LWGEOM.