PostGIS  2.1.10dev-r@@SVN_REVISION@@
static void out_geojson_test_precision ( void  )
static

Definition at line 59 of file cu_out_geojson.c.

References do_geojson_test().

Referenced by out_geojson_suite_setup().

60 {
61  /* 0 precision, i.e a round */
63  "POINT(1.1111111111111 1.1111111111111)",
64  "{\"type\":\"Point\",\"coordinates\":[1,1]}",
65  NULL, 0, 0);
66 
67  /* 3 digits precision */
69  "POINT(1.1111111111111 1.1111111111111)",
70  "{\"type\":\"Point\",\"coordinates\":[1.111,1.111]}",
71  NULL, 3, 0);
72 
73  /* 9 digits precision */
75  "POINT(1.2345678901234 1.2345678901234)",
76  "{\"type\":\"Point\",\"coordinates\":[1.23456789,1.23456789]}",
77  NULL, 9, 0);
78 
79  /* huge data */
81  "POINT(1E300 -1E300)",
82  "{\"type\":\"Point\",\"coordinates\":[1e+300,-1e+300]}",
83  NULL, 0, 0);
84 
85  /* huge precision, see http://trac.osgeo.org/postgis/ticket/2052 */
87  "POINT(1 2)",
88  "{\"type\":\"Point\",\"coordinates\":[1,2]}",
89  NULL, 100, 0);
90 
91  /* double precision, see http://trac.osgeo.org/postgis/ticket/2051 */
93  "POINT(59.99 -59.99)",
94  "{\"type\":\"Point\",\"coordinates\":[59.99,-59.99]}",
95  NULL, 15, 0);
96 
97  /* small numbers */
98  /* NOTE: precision of 300 will be converted to max precision (15)
99  * and being there no significant digit within that range
100  * only zeroes will be returned
101  * See http://trac.osgeo.org/postgis/ticket/2051#comment:11
102  */
104  "POINT(1E-300 -2E-200)",
105  "{\"type\":\"Point\",\"coordinates\":[0,-0]}",
106  NULL, 300, 0);
107 
108 }
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: