15 #include "CUnit/Basic.h"
29 fprintf(stderr,
"\nIn: %s\nOut: %s\nTheo: %s\n", in, h, out);
31 CU_ASSERT_STRING_EQUAL(h, out);
47 fprintf(stderr,
"\nIn: %s\nOut: %s\nTheo: %s\n",
62 "POINT(1.1111111111111 1.1111111111111 2.11111111111111)",
68 "POINT(1.1111111111111 1.1111111111111 2.11111111111111)",
74 "POINT(1.2345678901234 1.2345678901234 4.123456789001)",
75 "1.23456789 1.23456789 4.123456789",
80 "POINT(1E300 -105E-153 4E300)",
"1e+300 0 4e+300", NULL, 0, 0);
88 "LINESTRING(0 1 5,2 3 6,4 5 7)",
89 "<LineSet vertexCount='3'><Coordinate point='0 1 5 2 3 6 4 5 7' /></LineSet>",
94 "POLYGON((15 10 3,13.536 6.464 3,10 5 3,6.464 6.464 3,5 10 3,6.464 13.536 3,10 15 3,13.536 13.536 3,15 10 3))",
95 "<IndexedFaceSet convex='false' coordIndex='0 1 2 3 4 5 6 7'><Coordinate point='15 10 3 13.536 6.464 3 10 5 3 6.464 6.464 3 5 10 3 6.464 13.536 3 10 15 3 13.536 13.536 3 ' /></IndexedFaceSet>",
106 "MULTIPOINT(0 1,2 3,4 5)",
107 "<Polypoint2D point='0 1 2 3 4 5 ' />",
112 "MULTIPOINT Z(0 1 1,2 3 4,4 5 5)",
113 "<PointSet ><Coordinate point='0 1 1 2 3 4 4 5 5 ' /></PointSet>",
117 "MULTILINESTRING Z((0 1 1,2 3 4,4 5 5),(6 7 5,8 9 8,10 11 5))",
118 "<IndexedLineSet coordIndex='0 1 2 -1 3 4 5'><Coordinate point='0 1 1 2 3 4 4 5 5 6 7 5 8 9 8 10 11 5 ' /></IndexedLineSet>",
123 "MULTIPOLYGON(((0 1 1,2 3 1,4 5 1,0 1 1)),((6 7 1,8 9 1,10 11 1,6 7 1)))",
124 "<IndexedFaceSet convex='false' coordIndex='0 1 2 -1 3 4 5'><Coordinate point='0 1 1 2 3 1 4 5 1 6 7 1 8 9 1 10 11 1 ' /></IndexedFaceSet>",
129 "POLYHEDRALSURFACE( ((0 0 0, 0 0 1, 0 1 1, 0 1 0, 0 0 0)), ((0 0 0, 0 1 0, 1 1 0, 1 0 0, 0 0 0)), ((0 0 0, 1 0 0, 1 0 1, 0 0 1, 0 0 0)), ((1 1 0, 1 1 1, 1 0 1, 1 0 0, 1 1 0)), ((0 1 0, 0 1 1, 1 1 1, 1 1 0, 0 1 0)), ((0 0 1, 1 0 1, 1 1 1, 0 1 1, 0 0 1)) )",
130 "<IndexedFaceSet convex='false' coordIndex='0 1 2 3 -1 4 5 6 7 -1 8 9 10 11 -1 12 13 14 15 -1 16 17 18 19 -1 20 21 22 23'><Coordinate point='0 0 0 0 0 1 0 1 1 0 1 0 0 0 0 0 1 0 1 1 0 1 0 0 0 0 0 1 0 0 1 0 1 0 0 1 1 1 0 1 1 1 1 0 1 1 0 0 0 1 0 0 1 1 1 1 1 1 1 0 0 0 1 1 0 1 1 1 1 0 1 1' /></IndexedFaceSet>",
147 "CIRCULARSTRING(-2 0 1,0 2 1,2 0 1,0 2 1,2 4 1)",
148 "lwgeom_to_x3d3: 'CircularString' geometry type not supported");
152 "COMPOUNDCURVE(CIRCULARSTRING(0 0 1,1 1 1,1 0 1),(1 0 1,0 1 1))",
153 "lwgeom_to_x3d3: 'CompoundCurve' geometry type not supported");
161 "POINT(3.1111111111111 1.1111111111111 2.11111111111111)",
167 "SRID=4326;POLYGON((15 10 3,13.536 6.464 3,10 5 3,6.464 6.464 3,5 10 3,6.464 13.536 3,10 15 3,13.536 13.536 3,15 10 3))",
168 "<IndexedFaceSet convex='false' coordIndex='0 1 2 3 4 5 6 7'><GeoCoordinate geoSystem='\"GD\" \"WE\" \"longitude_first\"' point='15 10 3 13.536 6.464 3 10 5 3 6.464 6.464 3 5 10 3 6.464 13.536 3 10 15 3 13.536 13.536 3 ' /></IndexedFaceSet>",
173 "SRID=4326;POLYGON((15 10 3,13.536 6.464 3,10 5 3,6.464 6.464 3,5 10 3,6.464 13.536 3,10 15 3,13.536 13.536 3,15 10 3))",
174 "<IndexedFaceSet convex='false' coordIndex='0 1 2 3 4 5 6 7'><GeoCoordinate geoSystem='\"GD\" \"WE\" \"latitude_first\"' point='10 15 3 6.464 13.536 3 5 10 3 6.464 6.464 3 10 5 3 13.536 6.464 3 15 10 3 13.536 13.536 3 ' /></IndexedFaceSet>",
185 CU_pSuite suite = CU_add_suite(
"x3d_output", NULL, NULL);
void out_x3d_suite_setup(void)
static void do_x3d3_unsupported(char *in, char *out)
static void out_x3d3_test_precision(void)
static void out_x3d3_test_option(void)
static void out_x3d3_test_geoms(void)
static void do_x3d3_test(char *in, char *out, char *srs, int precision, int option)
void cu_error_msg_reset()
char cu_error_msg[MAX_CUNIT_ERROR_LENGTH+1]
#define PG_ADD_TEST(suite, testfunc)
void lwgeom_free(LWGEOM *geom)
#define LW_PARSER_CHECK_NONE
char * lwgeom_to_x3d3(const LWGEOM *geom, char *srs, int precision, int opts, const char *defid)
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)