]> granicus.if.org Git - postgis/commitdiff
Add json casts to doc, set json cast precision
authorPaul Ramsey <pramsey@cleverelephant.ca>
Tue, 30 Apr 2019 16:45:35 +0000 (16:45 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Tue, 30 Apr 2019 16:45:35 +0000 (16:45 +0000)
to defaults used in other functions

git-svn-id: http://svn.osgeo.org/postgis/trunk@17418 b70326c6-7e19-0410-871a-916f4a2858ee

doc/reference_output.xml
doc/reference_type.xml
postgis/lwgeom_export.c

index e585afba8aedf6ed27988523d3ded08af059a58e..7cea2f22a71b7f4be4c3f80b85cdf3a3e6109f63 100644 (file)
@@ -329,22 +329,22 @@ CIRCULARSTRING(220268 150415 1,220227 150505 2,220227 150406 3)
                <funcsynopsis>
                        <funcprototype>
                                <funcdef>text <function>ST_AsGeoJSON</function></funcdef>
-                               <paramdef><type>record </type> <parameter>feature</parameter></paramdef>
-                               <paramdef choice="opt"><type>text </type> <parameter>geomcolumnname</parameter></paramdef>
+                               <paramdef><type>geometry </type> <parameter>geom</parameter></paramdef>
                                <paramdef choice="opt"><type>integer </type> <parameter>maxdecimaldigits=15</parameter></paramdef>
-                               <paramdef choice="opt"><type>boolean </type> <parameter>prettyprint=false</parameter></paramdef>
+                               <paramdef choice="opt"><type>integer </type> <parameter>options=0</parameter></paramdef>
                        </funcprototype>
                        <funcprototype>
                                <funcdef>text <function>ST_AsGeoJSON</function></funcdef>
-                               <paramdef><type>geometry </type> <parameter>geom</parameter></paramdef>
+                               <paramdef><type>geography </type> <parameter>geog</parameter></paramdef>
                                <paramdef choice="opt"><type>integer </type> <parameter>maxdecimaldigits=15</parameter></paramdef>
                                <paramdef choice="opt"><type>integer </type> <parameter>options=0</parameter></paramdef>
                        </funcprototype>
                        <funcprototype>
                                <funcdef>text <function>ST_AsGeoJSON</function></funcdef>
-                               <paramdef><type>geography </type> <parameter>geog</parameter></paramdef>
+                               <paramdef><type>record </type> <parameter>feature</parameter></paramdef>
+                               <paramdef choice="opt"><type>text </type> <parameter>geomcolumnname</parameter></paramdef>
                                <paramdef choice="opt"><type>integer </type> <parameter>maxdecimaldigits=15</parameter></paramdef>
-                               <paramdef choice="opt"><type>integer </type> <parameter>options=0</parameter></paramdef>
+                               <paramdef choice="opt"><type>boolean </type> <parameter>prettyprint=false</parameter></paramdef>
                        </funcprototype>
                </funcsynopsis>
          </refsynopsisdiv>
@@ -377,12 +377,6 @@ CIRCULARSTRING(220268 150415 1,220227 150505 2,220227 150406 3)
                                </listitem>
                          </itemizedlist>
                        </para>
-                       <para>Version 1: ST_AsGeoJSON(geom) / maxdecimaldigits=15 version=1 options=0</para>
-                       <para>Version 2: ST_AsGeoJSON(geom, maxdecimaldigits) / version=1 options=0</para>
-                       <para>Version 3: ST_AsGeoJSON(geom, maxdecimaldigits, options) / version=1</para>
-                       <para>Version 4: ST_AsGeoJSON(gj_version, geom) / maxdecimaldigits=15 options=0</para>
-                       <para>Version 5: ST_AsGeoJSON(gj_version, geom, maxdecimaldigits) / options=0</para>
-                       <para>Version 6: ST_AsGeoJSON(gj_version, geom, maxdecimaldigits, options)</para>
 
                        <para>Availability: 1.3.4</para>
                        <para>Availability: 1.5.0 geography support was introduced.</para>
index 62f1b0ebe66f48a26027cd86cc9911d71d4958f9..7f5eecb90ae10994bb7b731d1e681c8744bb79dd 100644 (file)
                                <entry>text</entry>
                                <entry>automatic</entry>
                          </row>
+                         <row>
+                               <entry>json</entry>
+                               <entry>automatic</entry>
+                         </row>
+                         <row>
+                               <entry>jsonb</entry>
+                               <entry>automatic</entry>
+                         </row>
                        </tbody>
                </tgroup>
                </informaltable>
index 54aac7ac16222d5b3bb7337e22b8fdf43d9e9662..7759b8970f10b5eff742db83f0b6800e80775ee7 100644 (file)
@@ -431,7 +431,7 @@ Datum geometry_to_json(PG_FUNCTION_ARGS)
 {
        GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P(0);
        LWGEOM *lwgeom = lwgeom_from_gserialized(geom);
-       char *geojson = lwgeom_to_geojson(lwgeom, NULL, 9, 0);
+       char *geojson = lwgeom_to_geojson(lwgeom, NULL, 15, 0);
        text *result = cstring_to_text(geojson);
        lwgeom_free(lwgeom);
        pfree(geojson);
@@ -444,7 +444,7 @@ Datum geometry_to_jsonb(PG_FUNCTION_ARGS)
 {
        GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P(0);
        LWGEOM *lwgeom = lwgeom_from_gserialized(geom);
-       char *geojson = lwgeom_to_geojson(lwgeom, NULL, 9, 0);
+       char *geojson = lwgeom_to_geojson(lwgeom, NULL, 15, 0);
        lwgeom_free(lwgeom);
        PG_RETURN_DATUM(DirectFunctionCall1(jsonb_in, PointerGetDatum(geojson)));
 }