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)",
68 "POINT(1.1111111111111 1.1111111111111)",
74 "LINESTRING(1.1111111111111 1.1111111111111,1.1111111111111 1.1111111111111)",
80 "LINESTRING(1.1111111111111 1.1111111111111,1.1111111111111 1.1111111111111)",
87 "POINT(1.2345678901234 1.2345678901234)",
88 "cx=\"1.23456789\" cy=\"-1.23456789\"",
93 "POINT(1.2345678901234 1.2345678901234)",
94 "x=\"1.23456789\" y=\"-1.23456789\"",
99 "LINESTRING(1.2345678901234 1.2345678901234,2.3456789012345 2.3456789012345)",
100 "M 1.23456789 -1.23456789 L 2.345678901 -2.345678901",
105 "LINESTRING(1.2345678901234 1.2345678901234,2.3456789012345 2.3456789012345)",
106 "M 1.23456789 -1.23456789 l 1.111111011 -1.111111011",
112 "POINT(1E300 -1E300)",
113 "cx=\"1e+300\" cy=\"1e+300\"",
118 "POINT(1E300 -1E300)",
119 "x=\"1e+300\" y=\"1e+300\"",
124 "LINESTRING(1E300 -1E300,1E301 -1E301)",
125 "M 1e+300 1e+300 L 1e+301 1e+301",
130 "LINESTRING(1E300 -1E300,1E301 -1E301)",
131 "M 1e+300 1e+300 l 9e+300 9e+300",
141 "cx=\"0\" cy=\"-1\"",
152 "LINESTRING(0 1 2 3,4 5 6 7)",
158 "LINESTRING(0 1 2 3,4 5 6 7)",
168 "LINESTRING(0 1,2 3,4 5)",
169 "M 0 -1 L 2 -3 4 -5",
174 "POLYGON((0 1,2 3,4 5,0 1))",
175 "M 0 -1 L 2 -3 4 -5 Z",
180 "POLYGON((0 1,2 3,4 5,0 1),(6 7,8 9,10 11,6 7))",
181 "M 0 -1 L 2 -3 4 -5 Z M 6 -7 L 8 -9 10 -11 Z",
186 "MULTIPOINT(0 1,2 3)",
187 "cx=\"0\" cy=\"-1\",cx=\"2\" cy=\"-3\"",
192 "MULTILINESTRING((0 1,2 3,4 5),(6 7,8 9,10 11))",
193 "M 0 -1 L 2 -3 4 -5 M 6 -7 L 8 -9 10 -11",
198 "MULTIPOLYGON(((0 1,2 3,4 5,0 1)),((6 7,8 9,10 11,6 7)))",
199 "M 0 -1 L 2 -3 4 -5 Z M 6 -7 L 8 -9 10 -11 Z",
204 "GEOMETRYCOLLECTION(POINT(0 1),LINESTRING(2 3,4 5))",
205 "cx=\"0\" cy=\"-1\";M 2 -3 L 4 -5",
210 "GEOMETRYCOLLECTION EMPTY",
216 "GEOMETRYCOLLECTION(POINT(0 1),GEOMETRYCOLLECTION(LINESTRING(2 3,4 5)))",
217 "assvg_geom_buf: 'GeometryCollection' geometry type not supported.");
221 "CIRCULARSTRING(-2 0,0 2,2 0,0 2,2 4)",
222 "lwgeom_to_svg: 'CircularString' geometry type not supported");
226 "COMPOUNDCURVE(CIRCULARSTRING(0 0,1 1,1 0),(1 0,0 1))",
227 "lwgeom_to_svg: 'CompoundCurve' geometry type not supported");
231 "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))",
232 "lwgeom_to_svg: 'CurvePolygon' geometry type not supported");
236 "MULTICURVE((5 5,3 5,3 3,0 3),CIRCULARSTRING(0 0,2 1,2 2))",
237 "lwgeom_to_svg: 'MultiCurve' geometry type not supported");
241 "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)))",
242 "lwgeom_to_svg: 'MultiSurface' geometry type not supported");
249 "LINESTRING(0 1,2 3,4 5)",
250 "M 0 -1 l 2 -2 2 -2",
255 "POLYGON((0 1,2 3,4 5,0 1))",
256 "M 0 -1 l 2 -2 2 -2 z",
261 "POLYGON((0 1,2 3,4 5,0 1),(6 7,8 9,10 11,6 7))",
262 "M 0 -1 l 2 -2 2 -2 z M 6 -7 l 2 -2 2 -2 z",
267 "MULTIPOINT(0 1,2 3)",
268 "x=\"0\" y=\"-1\",x=\"2\" y=\"-3\"",
273 "MULTILINESTRING((0 1,2 3,4 5),(6 7,8 9,10 11))",
274 "M 0 -1 l 2 -2 2 -2 M 6 -7 l 2 -2 2 -2",
279 "MULTIPOLYGON(((0 1,2 3,4 5,0 1)),((6 7,8 9,10 11,6 7)))",
280 "M 0 -1 l 2 -2 2 -2 z M 6 -7 l 2 -2 2 -2 z",
285 "GEOMETRYCOLLECTION(POINT(0 1),LINESTRING(2 3,4 5))",
286 "x=\"0\" y=\"-1\";M 2 -3 l 2 -2",
294 "SRID=4326;POINT(0 1)",
295 "cx=\"0\" cy=\"-1\"",
300 "SRID=4326;POINT(0 1)",
306 "SRID=4326;LINESTRING(0 1,2 3)",
312 "SRID=4326;LINESTRING(0 1,2 3)",
323 CU_pSuite suite = CU_add_suite(
"svg_output", NULL, NULL);
char * lwgeom_to_svg(const LWGEOM *geom, int precision, int relative)
Takes a GEOMETRY and returns a SVG representation.
void lwgeom_free(LWGEOM *geom)
static void out_svg_test_relative(void)
static void out_svg_test_precision(void)
static void out_svg_test_srid(void)
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
static void do_svg_test(char *in, char *out, int precision, int relative)
static void out_svg_test_dims(void)
#define LW_PARSER_CHECK_NONE
void out_svg_suite_setup(void)
void cu_error_msg_reset()
#define PG_ADD_TEST(suite, testfunc)
static void out_svg_test_geoms(void)
static void do_svg_unsupported(char *in, char *out)
char cu_error_msg[MAX_CUNIT_ERROR_LENGTH+1]