201{
202
204 "LINESTRING(0 1,2 3,4 5)",
205 "{\"type\":\"LineString\",\"coordinates\":[[0,1],[2,3],[4,5]]}",
206 NULL, 0, 0);
207
208
210 "POLYGON((0 1,2 3,4 5,0 1))",
211 "{\"type\":\"Polygon\",\"coordinates\":[[[0,1],[2,3],[4,5],[0,1]]]}",
212 NULL, 0, 0);
213
214
216 "POLYGON((0 1,2 3,4 5,0 1),(6 7,8 9,10 11,6 7))",
217 "{\"type\":\"Polygon\",\"coordinates\":[[[0,1],[2,3],[4,5],[0,1]],[[6,7],[8,9],[10,11],[6,7]]]}",
218 NULL, 0, 0);
219
220
222 "MULTILINESTRING((0 1,2 3,4 5),(6 7,8 9,10 11))",
223 "{\"type\":\"MultiLineString\",\"coordinates\":[[[0,1],[2,3],[4,5]],[[6,7],[8,9],[10,11]]]}",
224 NULL, 0, 0);
225
226
228 "MULTIPOLYGON(((0 1,2 3,4 5,0 1)),((6 7,8 9,10 11,6 7)))",
229 "{\"type\":\"MultiPolygon\",\"coordinates\":[[[[0,1],[2,3],[4,5],[0,1]]],[[[6,7],[8,9],[10,11],[6,7]]]]}",
230 NULL, 0, 0);
231
232
234 "GEOMETRYCOLLECTION(POINT(0 1),LINESTRING(2 3,4 5))",
235 "{\"type\":\"GeometryCollection\",\"geometries\":[{\"type\":\"Point\",\"coordinates\":[0,1]},{\"type\":\"LineString\",\"coordinates\":[[2,3],[4,5]]}]}",
236 NULL, 0, 0);
237
238
240 "GEOMETRYCOLLECTION EMPTY",
241 "{\"type\":\"GeometryCollection\",\"geometries\":[]}",
242 NULL, 0, 0);
243
244
246 "GEOMETRYCOLLECTION(POINT(0 1),GEOMETRYCOLLECTION(LINESTRING(2 3,4 5)))",
247 "GeoJson: geometry not supported.");
248
249
251 "CIRCULARSTRING(-2 0,0 2,2 0,0 2,2 4)",
252 "lwgeom_to_geojson: 'CircularString' geometry type not supported");
253
254
256 "COMPOUNDCURVE(CIRCULARSTRING(0 0,1 1,1 0),(1 0,0 1))",
257 "lwgeom_to_geojson: 'CompoundCurve' geometry type not supported");
258
259
261 "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))",
262 "lwgeom_to_geojson: 'CurvePolygon' geometry type not supported");
263
264
266 "MULTICURVE((5 5,3 5,3 3,0 3),CIRCULARSTRING(0 0,2 1,2 2))",
267 "lwgeom_to_geojson: 'MultiCurve' geometry type not supported");
268
269
271 "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)))",
272 "lwgeom_to_geojson: 'MultiSurface' geometry type not supported");
273}
static void do_geojson_unsupported(char *in, char *out)
static void do_geojson_test(char *in, char *out, char *srs, int precision, int has_bbox)