153{
154
156 "LINESTRING(0 1,2 3,4 5)",
157 "{\"type\":\"LineString\",\"coordinates\":[[0,1],[2,3],[4,5]]}",
158 NULL);
159
160
162 "POLYGON((0 1,2 3,4 5,0 1))",
163 "{\"type\":\"Polygon\",\"coordinates\":[[[0,1],[2,3],[4,5],[0,1]]]}",
164 NULL);
165
166
168 "POLYGON((0 1,2 3,4 5,0 1),(6 7,8 9,10 11,6 7))",
169 "{\"type\":\"Polygon\",\"coordinates\":[[[0,1],[2,3],[4,5],[0,1]],[[6,7],[8,9],[10,11],[6,7]]]}",
170 NULL);
171
172
174 "MULTILINESTRING((0 1,2 3,4 5),(6 7,8 9,10 11))",
175 "{\"type\":\"MultiLineString\",\"coordinates\":[[[0,1],[2,3],[4,5]],[[6,7],[8,9],[10,11]]]}",
176 NULL);
177
178
180 "MULTIPOLYGON(((0 1,2 3,4 5,0 1)),((6 7,8 9,10 11,6 7)))",
181 "{\"type\":\"MultiPolygon\",\"coordinates\":[[[[0,1],[2,3],[4,5],[0,1]]],[[[6,7],[8,9],[10,11],[6,7]]]]}",
182 NULL);
183
184
185
187 "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)))",
188 "{'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]]]]}",
189 NULL);
190
191
193 "GEOMETRYCOLLECTION(POINT(0 1),LINESTRING(2 3,4 5))",
194 "{\"type\":\"GeometryCollection\",\"geometries\":[{\"type\":\"Point\",\"coordinates\":[0,1]},{\"type\":\"LineString\",\"coordinates\":[[2,3],[4,5]]}]}",
195 NULL);
196
197
199 "GEOMETRYCOLLECTION EMPTY",
200 "{\"type\":\"GeometryCollection\",\"geometries\":[]}",
201 NULL);
202}
static void do_geojson_test(const char *exp, char *in, char *exp_srs)