[postgis-tickets] r16540 - Add doc notes, NEWS, and regress tests for json/jsonb (also add missing credits to NEWS)
Regina Obe
lr at pcorp.us
Mon Apr 16 01:20:29 PDT 2018
Author: robe
Date: 2018-04-16 01:20:29 -0700 (Mon, 16 Apr 2018)
New Revision: 16540
Modified:
trunk/NEWS
trunk/doc/reference_constructor.xml
trunk/regress/in_geojson.sql
trunk/regress/in_geojson_expected
Log:
Add doc notes, NEWS, and regress tests for json/jsonb (also add missing credits to NEWS)
Closes #4006 for 2.5.0
Modified: trunk/NEWS
===================================================================
--- trunk/NEWS 2018-04-16 07:54:21 UTC (rev 16539)
+++ trunk/NEWS 2018-04-16 08:20:29 UTC (rev 16540)
@@ -7,7 +7,7 @@
- #3989, ST_Buffer single sided option (Stephen Knox)
- #3876, ST_Angle function (RĂ©mi Cura)
- #3564, ST_LineInterpolatePoints (Dan Baston)
- - #3896, PostGIS_Extensions_Upgrade()
+ - #3896, PostGIS_Extensions_Upgrade() (Regina Obe)
- #3913, Upgrade when creating extension from unpackaged (Sandro Santilli)
- #2256, _postgis_index_extent() for extent from index (Paul Ramsey)
- #3176, Add ST_OrientedEnvelope (Dan Baston)
@@ -20,7 +20,7 @@
- #3893, raster support functions can only be loaded in the same schema
with core PostGIS functions.
- #4035, remove dummy pgis_abs type from aggregate/collect routines.
- - #4069, drop support for GEOS < 3.5 and PostgreSQL < 9.4
+ - #4069, drop support for GEOS < 3.5 and PostgreSQL < 9.4 (Regina Obe)
* Enhancements and Fixes*
- #3944, Update to EPSG register v9.2 (Even Rouault)
@@ -49,6 +49,8 @@
- #4020, Casting from box3d to geometry now returns correctly connected
PolyhedralSurface (Matthias Bay)
- #2508, ST_OffsetCurve now works with collections (Darafei Praliaskouski)
+ - #4006, ST_GeomFromGeoJSON support for json and jsonb as input
+ (Paul Ramsey, Regina Obe)
- #4037, Invalid input geometry is fixed with MakeValid for GEOS exceptions in
ST_Intersection, ST_Union, ST_Difference, ST_SymDifference (Darafei
Praliaskouski)
Modified: trunk/doc/reference_constructor.xml
===================================================================
--- trunk/doc/reference_constructor.xml 2018-04-16 07:54:21 UTC (rev 16539)
+++ trunk/doc/reference_constructor.xml 2018-04-16 08:20:29 UTC (rev 16540)
@@ -760,6 +760,17 @@
<funcdef>geometry <function>ST_GeomFromGeoJSON</function></funcdef>
<paramdef><type>text </type> <parameter>geomjson</parameter></paramdef>
</funcprototype>
+
+ <funcprototype>
+ <funcdef>geometry <function>ST_GeomFromGeoJSON</function></funcdef>
+ <paramdef><type>json </type> <parameter>geomjson</parameter></paramdef>
+ </funcprototype>
+
+ <funcprototype>
+ <funcdef>geometry <function>ST_GeomFromGeoJSON</function></funcdef>
+ <paramdef><type>jsonb </type> <parameter>geomjson</parameter></paramdef>
+ </funcprototype>
+
</funcsynopsis>
</refsynopsisdiv>
@@ -768,6 +779,7 @@
<para>Constructs a PostGIS geometry object from the GeoJSON representation.</para>
<para>ST_GeomFromGeoJSON works only for JSON Geometry fragments. It throws an error if you try to use it on a whole JSON document.</para>
+ <para>Enhanced: 2.5.0 can now accept json and jsonb as inputs.</para>
<para>Availability: 2.0.0 requires - JSON-C >= 0.9</para>
<note><para>If you do not have JSON-C enabled, support you will get an error notice instead of seeing an output.
To enable JSON-C, run configure --with-jsondir=/path/to/json-c. See <xref linkend="installation_configuration" /> for details.</para></note>
Modified: trunk/regress/in_geojson.sql
===================================================================
--- trunk/regress/in_geojson.sql 2018-04-16 07:54:21 UTC (rev 16539)
+++ trunk/regress/in_geojson.sql 2018-04-16 08:20:29 UTC (rev 16540)
@@ -5,7 +5,8 @@
select 'geomfromgeojson_04',st_astext(st_geomfromgeojson(st_asgeojson('LINESTRING(0 0,1 1)')));
select 'geomfromgeojson_05',st_astext(st_geomfromgeojson(st_asgeojson('POLYGON((0 0,1 1,1 0,0 0))')));
select 'geomfromgeojson_06',st_astext(st_geomfromgeojson(st_asgeojson('MULTIPOLYGON(((0 0,1 1,1 0,0 0)))')));
-
+select 'geomfromgeojson_07',st_astext(st_geomfromgeojson(st_asgeojson('MULTIPOLYGON(((0 0,1 1,1 0,0 0)))')::json));
+select 'geomfromgeojson_08',st_astext(st_geomfromgeojson(st_asgeojson('MULTIPOLYGON(((0 0,1 1,1 0,0 0)))')::jsonb));
-- #1434
select '#1434: Next two errors';
select '#1434.1',ST_GeomFromGeoJSON('{ "type": "Point", "crashme": [100.0, 0.0] }');
Modified: trunk/regress/in_geojson_expected
===================================================================
--- trunk/regress/in_geojson_expected 2018-04-16 07:54:21 UTC (rev 16539)
+++ trunk/regress/in_geojson_expected 2018-04-16 08:20:29 UTC (rev 16540)
@@ -4,6 +4,8 @@
geomfromgeojson_04|LINESTRING(0 0,1 1)
geomfromgeojson_05|POLYGON((0 0,1 1,1 0,0 0))
geomfromgeojson_06|MULTIPOLYGON(((0 0,1 1,1 0,0 0)))
+geomfromgeojson_07|MULTIPOLYGON(((0 0,1 1,1 0,0 0)))
+geomfromgeojson_08|MULTIPOLYGON(((0 0,1 1,1 0,0 0)))
#1434: Next two errors
ERROR: Unable to find 'coordinates' in GeoJSON string
ERROR: unexpected character (at offset 0)
More information about the postgis-tickets
mailing list