223{
224
226 "LINESTRING(0 1,2 3,4 5)",
227 "{\"type\":\"LineString\",\"coordinates\":[[0,1],[2,3],[4,5]]}",
228 NULL, 0, 0);
229
230
232 "POLYGON((0 1,2 3,4 5,0 1))",
233 "{\"type\":\"Polygon\",\"coordinates\":[[[0,1],[2,3],[4,5],[0,1]]]}",
234 NULL, 0, 0);
235
236
238 "POLYGON((0 1,2 3,4 5,0 1),(6 7,8 9,10 11,6 7))",
239 "{\"type\":\"Polygon\",\"coordinates\":[[[0,1],[2,3],[4,5],[0,1]],[[6,7],[8,9],[10,11],[6,7]]]}",
240 NULL, 0, 0);
241
242
244 "MULTILINESTRING((0 1,2 3,4 5),(6 7,8 9,10 11))",
245 "{\"type\":\"MultiLineString\",\"coordinates\":[[[0,1],[2,3],[4,5]],[[6,7],[8,9],[10,11]]]}",
246 NULL, 0, 0);
247
248
250 "MULTIPOLYGON(((0 1,2 3,4 5,0 1)),((6 7,8 9,10 11,6 7)))",
251 "{\"type\":\"MultiPolygon\",\"coordinates\":[[[[0,1],[2,3],[4,5],[0,1]]],[[[6,7],[8,9],[10,11],[6,7]]]]}",
252 NULL, 0, 0);
253
254
256 "GEOMETRYCOLLECTION(POINT(0 1),LINESTRING(2 3,4 5))",
257 "{\"type\":\"GeometryCollection\",\"geometries\":[{\"type\":\"Point\",\"coordinates\":[0,1]},{\"type\":\"LineString\",\"coordinates\":[[2,3],[4,5]]}]}",
258 NULL, 0, 0);
259
260
262 "GEOMETRYCOLLECTION EMPTY",
263 "{\"type\":\"GeometryCollection\",\"geometries\":[]}",
264 NULL, 0, 0);
265
266
268 "GEOMETRYCOLLECTION(POINT(0 1),GEOMETRYCOLLECTION(LINESTRING(2 3,4 5)))",
269 "GeoJson: geometry not supported.");
270
271
273 "CIRCULARSTRING(-2 0,0 2,2 0,0 2,2 4)",
274 "lwgeom_to_geojson: 'CircularString' geometry type not supported");
275
276
278 "COMPOUNDCURVE(CIRCULARSTRING(0 0,1 1,1 0),(1 0,0 1))",
279 "lwgeom_to_geojson: 'CompoundCurve' geometry type not supported");
280
281
283 "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))",
284 "lwgeom_to_geojson: 'CurvePolygon' geometry type not supported");
285
286
288 "MULTICURVE((5 5,3 5,3 3,0 3),CIRCULARSTRING(0 0,2 1,2 2))",
289 "lwgeom_to_geojson: 'MultiCurve' geometry type not supported");
290
291
293 "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)))",
294 "lwgeom_to_geojson: 'MultiSurface' geometry type not supported");
295}
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)