157{
158
160 "LINESTRING(0 1,2 3,4 5)",
161 "{\"type\":\"LineString\",\"coordinates\":[[0,1],[2,3],[4,5]]}",
162 NULL);
163
164
166 "POLYGON((0 1,2 3,4 5,0 1))",
167 "{\"type\":\"Polygon\",\"coordinates\":[[[0,1],[2,3],[4,5],[0,1]]]}",
168 NULL);
169
170
172 "POLYGON((0 1,2 3,4 5,0 1),(6 7,8 9,10 11,6 7))",
173 "{\"type\":\"Polygon\",\"coordinates\":[[[0,1],[2,3],[4,5],[0,1]],[[6,7],[8,9],[10,11],[6,7]]]}",
174 NULL);
175
176
178 "MULTILINESTRING((0 1,2 3,4 5),(6 7,8 9,10 11))",
179 "{\"type\":\"MultiLineString\",\"coordinates\":[[[0,1],[2,3],[4,5]],[[6,7],[8,9],[10,11]]]}",
180 NULL);
181
182
184 "MULTIPOLYGON(((0 1,2 3,4 5,0 1)),((6 7,8 9,10 11,6 7)))",
185 "{\"type\":\"MultiPolygon\",\"coordinates\":[[[[0,1],[2,3],[4,5],[0,1]]],[[[6,7],[8,9],[10,11],[6,7]]]]}",
186 NULL);
187
188
189
191 "MULTIPOLYGON(((4 0,0 -4,-4 0,0 4,4 0),(2 0,0 2,-2 0,0 -2,2 0)),((24 0,20 -4,16 0,20 4,24 0),(22 0,20 2,18 0,20 -2,22 0)),((44 0,40 -4,36 0,40 4,44 0),(42 0,40 2,38 0,40 -2,42 0)))",
192 "{'type':'MultiPolygon','coordinates':[[[[4,0],[0,-4],[-4,0],[0,4],[4,0]],[[2,0],[0,2],[-2,0],[0,-2],[2,0]]],[[[24,0],[20,-4],[16,0],[20,4],[24,0]],[[22,0],[20,2],[18,0],[20,-2],[22,0]]],[[[44,0],[40,-4],[36,0],[40,4],[44,0]],[[42,0],[40,2],[38,0],[40,-2],[42,0]]]]}",
193 NULL);
194
195
197 "GEOMETRYCOLLECTION(POINT(0 1),LINESTRING(2 3,4 5))",
198 "{\"type\":\"GeometryCollection\",\"geometries\":[{\"type\":\"Point\",\"coordinates\":[0,1]},{\"type\":\"LineString\",\"coordinates\":[[2,3],[4,5]]}]}",
199 NULL);
200
201
203 "GEOMETRYCOLLECTION EMPTY",
204 "{\"type\":\"GeometryCollection\",\"geometries\":[]}",
205 NULL);
206
207
209 "POINT EMPTY",
210 "{\"type\":\"Point\",\"coordinates\":[]}",
211 NULL);
212
213
215 "LINESTRING EMPTY",
216 "{\"type\":\"LineString\",\"coordinates\":[]}",
217 NULL);
218
219
221 "POLYGON EMPTY",
222 "{\"type\":\"Polygon\",\"coordinates\":[]}",
223 NULL);
224
225
227 "MULTIPOINT EMPTY",
228 "{\"type\":\"MultiPoint\",\"coordinates\":[]}",
229 NULL);
230
231
233 "MULTIPOLYGON EMPTY",
234 "{\"type\":\"MultiPolygon\",\"coordinates\":[]}",
235 NULL);
236}
static void do_geojson_test(const char *exp, char *in, char *exp_srs)