PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ out_geojson_test_bbox()

static void out_geojson_test_bbox ( void  )
static

Definition at line 177 of file cu_out_geojson.c.

References do_geojson_test().

Referenced by out_geojson_suite_setup().

178 {
179  /* Linestring */
181  "LINESTRING(0 1,2 3,4 5)",
182  "{\"type\":\"LineString\",\"bbox\":[0,1,4,5],\"coordinates\":[[0,1],[2,3],[4,5]]}",
183  NULL, 0, 1);
184 
185  /* Polygon */
187  "POLYGON((0 1,2 3,4 5,0 1))",
188  "{\"type\":\"Polygon\",\"bbox\":[0,1,4,5],\"coordinates\":[[[0,1],[2,3],[4,5],[0,1]]]}",
189  NULL, 0, 1);
190 
191  /* Polygon - with internal ring */
193  "POLYGON((0 1,2 3,4 5,0 1),(6 7,8 9,10 11,6 7))",
194  "{\"type\":\"Polygon\",\"bbox\":[0,1,4,5],\"coordinates\":[[[0,1],[2,3],[4,5],[0,1]],[[6,7],[8,9],[10,11],[6,7]]]}",
195  NULL, 0, 1);
196 
197  /* Multiline */
199  "MULTILINESTRING((0 1,2 3,4 5),(6 7,8 9,10 11))",
200  "{\"type\":\"MultiLineString\",\"bbox\":[0,1,10,11],\"coordinates\":[[[0,1],[2,3],[4,5]],[[6,7],[8,9],[10,11]]]}",
201  NULL, 0, 1);
202 
203  /* MultiPolygon */
205  "MULTIPOLYGON(((0 1,2 3,4 5,0 1)),((6 7,8 9,10 11,6 7)))",
206  "{\"type\":\"MultiPolygon\",\"bbox\":[0,1,10,11],\"coordinates\":[[[[0,1],[2,3],[4,5],[0,1]]],[[[6,7],[8,9],[10,11],[6,7]]]]}",
207  NULL, 0, 1);
208 
209  /* GeometryCollection */
211  "GEOMETRYCOLLECTION(LINESTRING(0 1,-1 3),LINESTRING(2 3,4 5))",
212  "{\"type\":\"GeometryCollection\",\"bbox\":[-1,1,4,5],\"geometries\":[{\"type\":\"LineString\",\"coordinates\":[[0,1],[-1,3]]},{\"type\":\"LineString\",\"coordinates\":[[2,3],[4,5]]}]}",
213  NULL, 0, 1);
214 
215  /* Empty GeometryCollection */
217  "GEOMETRYCOLLECTION EMPTY",
218  "{\"type\":\"GeometryCollection\",\"geometries\":[]}",
219  NULL, 0, 1);
220 }
static void do_geojson_test(char *in, char *out, char *srs, int precision, int has_bbox)
Here is the call graph for this function:
Here is the caller graph for this function: