Skip to content

Commit

Permalink
Add doc notes, NEWS, and regress tests for json/jsonb (also add missi…
Browse files Browse the repository at this point in the history
…ng credits to NEWS)

Closes #4006 for 2.5.0

git-svn-id: http://svn.osgeo.org/postgis/trunk@16540 b70326c6-7e19-0410-871a-916f4a2858ee
  • Loading branch information
robe2 committed Apr 16, 2018
1 parent 7193d38 commit 414e9d2
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
6 changes: 4 additions & 2 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ PostGIS 2.5.0
- #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)
Expand All @@ -20,7 +20,7 @@ PostGIS 2.5.0
- #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)
Expand Down Expand Up @@ -49,6 +49,8 @@ PostGIS 2.5.0
- #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)
Expand Down
12 changes: 12 additions & 0 deletions doc/reference_constructor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,17 @@ SELECT ST_AsText(ST_GeomFromGeoHash('9qqj7nmxncgyy4d0dbxqz0', 10));
<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>

Expand All @@ -768,6 +779,7 @@ SELECT ST_AsText(ST_GeomFromGeoHash('9qqj7nmxncgyy4d0dbxqz0', 10));
<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 &gt;= 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>
Expand Down
3 changes: 2 additions & 1 deletion regress/in_geojson.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ select 'geomfromgeojson_03',st_astext(st_geomfromgeojson(st_asgeojson('POINT(1 1
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] }');
Expand Down
2 changes: 2 additions & 0 deletions regress/in_geojson_expected
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ geomfromgeojson_03|POINT(1 1)
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)
Expand Down

0 comments on commit 414e9d2

Please sign in to comment.