PostGIS  2.5.1dev-r@@SVN_REVISION@@

◆ out_geojson_test_geoms()

static void out_geojson_test_geoms ( void  )
static

Definition at line 222 of file cu_out_geojson.c.

References do_geojson_test(), do_geojson_unsupported(), and out_geojson_suite_setup().

Referenced by out_geojson_suite_setup().

223 {
224  /* Linestring */
226  "LINESTRING(0 1,2 3,4 5)",
227  "{\"type\":\"LineString\",\"coordinates\":[[0,1],[2,3],[4,5]]}",
228  NULL, 0, 0);
229 
230  /* Polygon */
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  /* Polygon - with internal ring */
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  /* Multiline */
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  /* MultiPolygon */
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  /* GeometryCollection */
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  /* Empty GeometryCollection */
262  "GEOMETRYCOLLECTION EMPTY",
263  "{\"type\":\"GeometryCollection\",\"geometries\":[]}",
264  NULL, 0, 0);
265 
266  /* Nested GeometryCollection */
268  "GEOMETRYCOLLECTION(POINT(0 1),GEOMETRYCOLLECTION(LINESTRING(2 3,4 5)))",
269  "GeoJson: geometry not supported.");
270 
271  /* CircularString */
273  "CIRCULARSTRING(-2 0,0 2,2 0,0 2,2 4)",
274  "lwgeom_to_geojson: 'CircularString' geometry type not supported");
275 
276  /* CompoundCurve */
278  "COMPOUNDCURVE(CIRCULARSTRING(0 0,1 1,1 0),(1 0,0 1))",
279  "lwgeom_to_geojson: 'CompoundCurve' geometry type not supported");
280 
281  /* CurvePolygon */
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  /* MultiCurve */
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  /* MultiSurface */
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_test(char *in, char *out, char *srs, int precision, int has_bbox)
static void do_geojson_unsupported(char *in, char *out)
Here is the call graph for this function:
Here is the caller graph for this function: