PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ in_geojson_test_geoms()

static void in_geojson_test_geoms ( void  )
static

Definition at line 152 of file cu_in_geojson.c.

References do_geojson_test(), and in_geojson_suite_setup().

Referenced by in_geojson_suite_setup().

153 {
154  /* Linestring */
156  "LINESTRING(0 1,2 3,4 5)",
157  "{\"type\":\"LineString\",\"coordinates\":[[0,1],[2,3],[4,5]]}",
158  NULL, 0, 0);
159 
160  /* Polygon */
162  "POLYGON((0 1,2 3,4 5,0 1))",
163  "{\"type\":\"Polygon\",\"coordinates\":[[[0,1],[2,3],[4,5],[0,1]]]}",
164  NULL, 0, 0);
165 
166  /* Polygon - with internal ring */
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, 0, 0);
171 
172  /* Multiline */
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, 0, 0);
177 
178  /* MultiPolygon */
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, 0, 0);
183 
184  /* MultiPolygon with internal rings */
185  /* See http://trac.osgeo.org/postgis/ticket/2216 */
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, 0, 0);
190 
191  /* GeometryCollection */
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, 0, 0);
196 
197  /* Empty GeometryCollection */
199  "GEOMETRYCOLLECTION EMPTY",
200  "{\"type\":\"GeometryCollection\",\"geometries\":[]}",
201  NULL, 0, 0);
202 }
static void do_geojson_test(const char *exp, char *in, char *exp_srs, int precision, int has_bbox)
Definition: cu_in_geojson.c:21
Here is the call graph for this function:
Here is the caller graph for this function: