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",
67 fprintf(stderr,
"\nPrefix: %s\nIn: %s\nOut: %s\nTheo: %s\n",
70 CU_ASSERT_STRING_EQUAL(h, out);
81 "POINT(1.1111111111111 1.1111111111111)",
82 "<Point><coordinates>1,1</coordinates></Point>",
87 "POINT(1.1111111111111 1.1111111111111)",
88 "<Point><coordinates>1.111,1.111</coordinates></Point>",
93 "POINT(1.2345678901234 1.2345678901234)",
94 "<Point><coordinates>1.23456789,1.23456789</coordinates></Point>",
99 "POINT(1E300 -1E300)",
100 "<Point><coordinates>1e+300,-1e+300</coordinates></Point>",
110 "<Point><coordinates>0,1,2</coordinates></Point>",
116 "<Point><coordinates>0,1</coordinates></Point>",
122 "<Point><coordinates>0,1,2</coordinates></Point>",
131 "LINESTRING(0 1,2 3,4 5)",
132 "<LineString><coordinates>0,1 2,3 4,5</coordinates></LineString>",
137 "POLYGON((0 1,2 3,4 5,0 1))",
138 "<Polygon><outerBoundaryIs><LinearRing><coordinates>0,1 2,3 4,5 0,1</coordinates></LinearRing></outerBoundaryIs></Polygon>",
143 "POLYGON((0 1,2 3,4 5,0 1),(6 7,8 9,10 11,6 7))",
144 "<Polygon><outerBoundaryIs><LinearRing><coordinates>0,1 2,3 4,5 0,1</coordinates></LinearRing></outerBoundaryIs><innerBoundaryIs><LinearRing><coordinates>6,7 8,9 10,11 6,7</coordinates></LinearRing></innerBoundaryIs></Polygon>",
149 "MULTIPOINT(0 1,2 3)",
150 "<MultiGeometry><Point><coordinates>0,1</coordinates></Point><Point><coordinates>2,3</coordinates></Point></MultiGeometry>",
155 "MULTILINESTRING((0 1,2 3,4 5),(6 7,8 9,10 11))",
156 "<MultiGeometry><LineString><coordinates>0,1 2,3 4,5</coordinates></LineString><LineString><coordinates>6,7 8,9 10,11</coordinates></LineString></MultiGeometry>",
161 "MULTIPOLYGON(((0 1,2 3,4 5,0 1)),((6 7,8 9,10 11,6 7)))",
162 "<MultiGeometry><Polygon><outerBoundaryIs><LinearRing><coordinates>0,1 2,3 4,5 0,1</coordinates></LinearRing></outerBoundaryIs></Polygon><Polygon><outerBoundaryIs><LinearRing><coordinates>6,7 8,9 10,11 6,7</coordinates></LinearRing></outerBoundaryIs></Polygon></MultiGeometry>",
167 "GEOMETRYCOLLECTION(POINT(0 1))",
168 "lwgeom_to_kml2: 'GeometryCollection' geometry type not supported");
172 "CIRCULARSTRING(-2 0,0 2,2 0,0 2,2 4)",
173 "lwgeom_to_kml2: 'CircularString' geometry type not supported");
177 "COMPOUNDCURVE(CIRCULARSTRING(0 0,1 1,1 0),(1 0,0 1))",
178 "lwgeom_to_kml2: 'CompoundCurve' geometry type not supported");
182 "CURVEPOLYGON(CIRCULARSTRING(-2 0,-1 -1,0 0,1 -1,2 0,0 2,-2 0),(-1 0,0 0.5,1 0,0 1,-1 0))",
183 "lwgeom_to_kml2: 'CurvePolygon' geometry type not supported");
187 "MULTICURVE((5 5,3 5,3 3,0 3),CIRCULARSTRING(0 0,2 1,2 2))",
188 "lwgeom_to_kml2: 'MultiCurve' geometry type not supported");
192 "MULTISURFACE(CURVEPOLYGON(CIRCULARSTRING(-2 0,-1 -1,0 0,1 -1,2 0,0 2,-2 0),(-1 0,0 0.5,1 0,0 1,-1 0)),((7 8,10 10,6 14,4 11,7 8)))",
193 "lwgeom_to_kml2: 'MultiSurface' geometry type not supported");
200 "LINESTRING(0 1,2 3,4 5)",
201 "<kml:LineString><kml:coordinates>0,1 2,3 4,5</kml:coordinates></kml:LineString>",
206 "POLYGON((0 1,2 3,4 5,0 1))",
207 "<kml:Polygon><kml:outerBoundaryIs><kml:LinearRing><kml:coordinates>0,1 2,3 4,5 0,1</kml:coordinates></kml:LinearRing></kml:outerBoundaryIs></kml:Polygon>",
212 "POLYGON((0 1,2 3,4 5,0 1),(6 7,8 9,10 11,6 7))",
213 "<kml:Polygon><kml:outerBoundaryIs><kml:LinearRing><kml:coordinates>0,1 2,3 4,5 0,1</kml:coordinates></kml:LinearRing></kml:outerBoundaryIs><kml:innerBoundaryIs><kml:LinearRing><kml:coordinates>6,7 8,9 10,11 6,7</kml:coordinates></kml:LinearRing></kml:innerBoundaryIs></kml:Polygon>",
218 "MULTIPOINT(0 1,2 3)",
219 "<kml:MultiGeometry><kml:Point><kml:coordinates>0,1</kml:coordinates></kml:Point><kml:Point><kml:coordinates>2,3</kml:coordinates></kml:Point></kml:MultiGeometry>",
224 "MULTILINESTRING((0 1,2 3,4 5),(6 7,8 9,10 11))",
225 "<kml:MultiGeometry><kml:LineString><kml:coordinates>0,1 2,3 4,5</kml:coordinates></kml:LineString><kml:LineString><kml:coordinates>6,7 8,9 10,11</kml:coordinates></kml:LineString></kml:MultiGeometry>",
230 "MULTIPOLYGON(((0 1,2 3,4 5,0 1)),((6 7,8 9,10 11,6 7)))",
231 "<kml:MultiGeometry><kml:Polygon><kml:outerBoundaryIs><kml:LinearRing><kml:coordinates>0,1 2,3 4,5 0,1</kml:coordinates></kml:LinearRing></kml:outerBoundaryIs></kml:Polygon><kml:Polygon><kml:outerBoundaryIs><kml:LinearRing><kml:coordinates>6,7 8,9 10,11 6,7</kml:coordinates></kml:LinearRing></kml:outerBoundaryIs></kml:Polygon></kml:MultiGeometry>",
241 CU_pSuite suite = CU_add_suite(
"kml_output", NULL, NULL);
static void out_kml_test_dims(void)
static void out_kml_test_prefix(void)
static void do_kml_test(char *in, char *out, int precision)
static void out_kml_test_precision(void)
void out_kml_suite_setup(void)
static void do_kml_test_prefix(char *in, char *out, int precision, const char *prefix)
static void out_kml_test_geoms(void)
static void do_kml_unsupported(char *in, char *out)
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_kml2(const LWGEOM *geom, int precision, const char *prefix)
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)