PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ out_svg_test_geoms()

static void out_svg_test_geoms ( void  )
static

Definition at line 148 of file cu_out_svg.c.

149 {
150  /* Linestring */
151  do_svg_test(
152  "LINESTRING(0 1,2 3,4 5)",
153  "M 0 -1 L 2 -3 4 -5",
154  0, 0);
155 
156  /* Polygon */
157  do_svg_test(
158  "POLYGON((0 1,2 3,4 5,0 1))",
159  "M 0 -1 L 2 -3 4 -5 Z",
160  0, 0);
161 
162  /* Polygon - with internal ring */
163  do_svg_test(
164  "POLYGON((0 1,2 3,4 5,0 1),(6 7,8 9,10 11,6 7))",
165  "M 0 -1 L 2 -3 4 -5 Z M 6 -7 L 8 -9 10 -11 Z",
166  0, 0);
167 
168  /* MultiPoint */
169  do_svg_test(
170  "MULTIPOINT(0 1,2 3)",
171  "cx=\"0\" cy=\"-1\",cx=\"2\" cy=\"-3\"",
172  0, 0);
173 
174  /* MultiLine */
175  do_svg_test(
176  "MULTILINESTRING((0 1,2 3,4 5),(6 7,8 9,10 11))",
177  "M 0 -1 L 2 -3 4 -5 M 6 -7 L 8 -9 10 -11",
178  0, 0);
179 
180  /* MultiPolygon */
181  do_svg_test(
182  "MULTIPOLYGON(((0 1,2 3,4 5,0 1)),((6 7,8 9,10 11,6 7)))",
183  "M 0 -1 L 2 -3 4 -5 Z M 6 -7 L 8 -9 10 -11 Z",
184  0, 0);
185 
186  /* GeometryCollection */
187  do_svg_test(
188  "GEOMETRYCOLLECTION(POINT(0 1),LINESTRING(2 3,4 5))",
189  "cx=\"0\" cy=\"-1\";M 2 -3 L 4 -5",
190  0, 0);
191 
192  /* CircularString */
193  do_svg_test(
194  "CIRCULARSTRING(-2 0,0 2,2 0,0 2,2 4)",
195  "M -2 0 A 2 2 0 0 1 2 0 A 2 2 0 0 1 2 -4",
196  0, 0);
197 
198  /* : Circle */
199  do_svg_test(
200  "CIRCULARSTRING(4 2,-2 2,4 2)",
201  "M 1 -2 m 3 0 a 3 3 0 1 0 -6 0 a 3 3 0 1 0 6 0",
202  0, 0);
203 
204  /* CompoundCurve */
205  do_svg_test(
206  "COMPOUNDCURVE(CIRCULARSTRING(0 0,1 1,1 0),(1 0,0 1))",
207  "M 0 0 A 1 1 0 1 1 1 0 L 0 -1", 0, 0);
208 
209  /* MultiCurve */
210  do_svg_test(
211  "MULTICURVE((5 5,3 5,3 3,0 3),CIRCULARSTRING(0 0,2 1,2 2))",
212  "M 5 -5 L 3 -5 3 -3 0 -3 M 0 0 A 2 2 0 0 0 2 -2", 0, 0);
213 
214  /* CurvePolygon */
215  do_svg_test(
216  "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))",
217  "M -2 0 A 1 1 0 0 0 0 0 A 1 1 0 0 0 2 0 A 2 2 0 0 0 -2 0 Z M -1 0 L 0 0 1 0 0 -1 -1 0 Z", 0, 0);
218 
219  /* MultiSurface */
220  do_svg_test(
221  "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)))",
222  "M -2 0 A 1 1 0 0 0 0 0 A 1 1 0 0 0 2 0 A 2 2 0 0 0 -2 0 Z M -1 0 L 0 0 1 0 0 -1 -1 0 Z M 7 -8 L 10 -10 6 -14 4 -11 Z", 0, 0);
223 
224  /* Empty GeometryCollection */
225  do_svg_test(
226  "GEOMETRYCOLLECTION EMPTY",
227  "",
228  0, 0);
229 
230  /* Nested GeometryCollection */
232  "GEOMETRYCOLLECTION(POINT(0 1),GEOMETRYCOLLECTION(LINESTRING(2 3,4 5)))",
233  "assvg_geom_buf: 'GeometryCollection' geometry type not supported.");
234 
235 }
static void do_svg_unsupported(char *in, char *out)
Definition: cu_out_svg.c:32
static void do_svg_test(char *in, char *out, int precision, int relative)
Definition: cu_out_svg.c:20

References do_svg_test(), and do_svg_unsupported().

Referenced by out_svg_suite_setup().

Here is the call graph for this function:
Here is the caller graph for this function: