<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>
</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>
{
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);
{
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)));
}