156{
157
159 "LINESTRING(0 1,2 3,4 5)",
160 "{\"type\":\"LineString\",\"bbox\":[0,1,4,5],\"coordinates\":[[0,1],[2,3],[4,5]]}",
161 NULL, 0, 1);
162
163
165 "POLYGON((0 1,2 3,4 5,0 1))",
166 "{\"type\":\"Polygon\",\"bbox\":[0,1,4,5],\"coordinates\":[[[0,1],[2,3],[4,5],[0,1]]]}",
167 NULL, 0, 1);
168
169
171 "POLYGON((0 1,2 3,4 5,0 1),(6 7,8 9,10 11,6 7))",
172 "{\"type\":\"Polygon\",\"bbox\":[0,1,4,5],\"coordinates\":[[[0,1],[2,3],[4,5],[0,1]],[[6,7],[8,9],[10,11],[6,7]]]}",
173 NULL, 0, 1);
174
175
177 "MULTILINESTRING((0 1,2 3,4 5),(6 7,8 9,10 11))",
178 "{\"type\":\"MultiLineString\",\"bbox\":[0,1,10,11],\"coordinates\":[[[0,1],[2,3],[4,5]],[[6,7],[8,9],[10,11]]]}",
179 NULL, 0, 1);
180
181
183 "MULTIPOLYGON(((0 1,2 3,4 5,0 1)),((6 7,8 9,10 11,6 7)))",
184 "{\"type\":\"MultiPolygon\",\"bbox\":[0,1,10,11],\"coordinates\":[[[[0,1],[2,3],[4,5],[0,1]]],[[[6,7],[8,9],[10,11],[6,7]]]]}",
185 NULL, 0, 1);
186
187
189 "GEOMETRYCOLLECTION(LINESTRING(0 1,-1 3),LINESTRING(2 3,4 5))",
190 "{\"type\":\"GeometryCollection\",\"bbox\":[-1,1,4,5],\"geometries\":[{\"type\":\"LineString\",\"coordinates\":[[0,1],[-1,3]]},{\"type\":\"LineString\",\"coordinates\":[[2,3],[4,5]]}]}",
191 NULL, 0, 1);
192
193
195 "GEOMETRYCOLLECTION EMPTY",
196 "{\"type\":\"GeometryCollection\",\"geometries\":[]}",
197 NULL, 0, 1);
198}
static void do_geojson_test(char *in, char *out, char *srs, int precision, int has_bbox)