PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ out_geojson_test_precision()

static void out_geojson_test_precision ( void  )
static

Definition at line 45 of file cu_out_geojson.c.

46{
47 /* 0 precision, i.e a round */
49 "POINT(1.1111111111111 1.1111111111111)",
50 "{\"type\":\"Point\",\"coordinates\":[1,1]}",
51 NULL, 0, 0);
52
53 /* 3 digits precision */
55 "POINT(1.1111111111111 1.1111111111111)",
56 "{\"type\":\"Point\",\"coordinates\":[1.111,1.111]}",
57 NULL, 3, 0);
58
59 /* 9 digits precision */
61 "POINT(1.2345678901234 1.2345678901234)",
62 "{\"type\":\"Point\",\"coordinates\":[1.23456789,1.23456789]}",
63 NULL, 9, 0);
64
65 /* huge data */
67 "POINT(1E300 -1E300)",
68 "{\"type\":\"Point\",\"coordinates\":[1e+300,-1e+300]}",
69 NULL, 0, 0);
70
71 /* huge precision, see http://trac.osgeo.org/postgis/ticket/2052 */
73 "POINT(1 2)",
74 "{\"type\":\"Point\",\"coordinates\":[1,2]}",
75 NULL, 100, 0);
76
77 /* double precision, see http://trac.osgeo.org/postgis/ticket/2051 */
79 "POINT(59.99 -59.99)",
80 "{\"type\":\"Point\",\"coordinates\":[59.99,-59.99]}",
81 NULL, 15, 0);
82
83 /* small numbers */
84 do_geojson_test("POINT(1E-300 -2E-200)", "{\"type\":\"Point\",\"coordinates\":[1e-300,-2e-200]}", NULL, 300, 0);
85}
static void do_geojson_test(char *in, char *out, char *srs, int precision, int has_bbox)

References do_geojson_test().

Referenced by out_geojson_suite_setup().

Here is the call graph for this function:
Here is the caller graph for this function: