]> granicus.if.org Git - postgis/commitdiff
Include old regression cases for GeoJSON
authorPaul Ramsey <pramsey@cleverelephant.ca>
Wed, 13 May 2015 18:06:21 +0000 (18:06 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Wed, 13 May 2015 18:06:21 +0000 (18:06 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@13495 b70326c6-7e19-0410-871a-916f4a2858ee

regress/in_geojson.sql
regress/in_geojson_expected

index 23325e857b61ecc823178c041755b8c7591868bb..b41ac6fc91784780031d12eb660824c7b746c0b4 100644 (file)
@@ -10,6 +10,12 @@ select 'geomfromgeojson_06',st_astext(st_geomfromgeojson(st_asgeojson('MULTIPOLY
 select '#1434: Next two errors';
 select '#1434.1',ST_GeomFromGeoJSON('{ "type": "Point", "crashme": [100.0, 0.0] }');
 select '#1434.2',ST_GeomFromGeoJSON('crashme');;
+select '#1434.3',ST_GeomFromGeoJSON('');
+select '#1434.4',ST_GeomFromGeoJSON('{}');
+select '#1434.5',ST_GeomFromGeoJSON('{"type":"Point","coordinates":[]}'); 
+select '#1434.6',ST_GeomFromGeoJSON('{"type":"MultiPoint","coordinates":[[]]}'); 
+select '#1434.7',ST_GeomFromGeoJSON('{"type":"MultiPoint"}'); 
+select '#1434.8',ST_GeomFromGeoJSON('{"type":"Point"}'); 
 
 -- #2130 --
 SELECT '#2130', ST_NPoints(ST_GeomFromGeoJSON('{"type":"MultiPolygon","coordinates":[[[[-117,32],[-117,32],[-117,32],[-117,32],[-117,32],[-117,32],[-117,32],[-117,32],[-117,32],[-117,32],[-117,32],[-117,32],[-117,32],[-117,33],[-117,33],[-117,33],[-117,33],[-117,33],[-117,33],[-117,33],[-117,33],[-117,33],[-117,33],[-117,33],[-117,33],[-117,32],[-117,32],[-117,32],[-117,32],[-116,32],[-116,32],[-116,32],[-116,32],[-116,32],[-116,32],[-116,32],[-116,32],[-116,32],[-116,32],[-117,32],[-117,32],[-117,32],[-117,32]],[[-117,33],[-117,33],[-117,33],[-117,33],[-117,33],[-117,32],[-117,33]]]]}'));
@@ -19,7 +25,19 @@ SELECT '#2216', ST_NPoints(ST_GeomFromGeoJSON('{"type":"MultiPolygon","coordinat
 
 -- #2619 --
 SELECT '#2619', ST_AsText(ST_GeomFromGeoJSON('{"type":"Polygon","bbox":[1,5,2,6],"coordinates":[]}'));
+select '#2619', ST_AsText(ST_GeomFromGeoJSON('{"type":"MultiPolygon","coordinates":[[]]}'));
 
 -- #2697 --
 SELECT '#2697', ST_GeomFromGeoJSON('{"type":"Polygon","coordinates":[1]}');
 SELECT '#2697', ST_GeomFromGeoJSON('{"type":"Polygon","coordinates":[1,1]}');
+
+-- FromGeoJSON 3D
+
+SELECT 'geomfromgeojson_z_01', ST_AsEWKT(ST_GeomFromGeoJSON('{"type":"Point","coordinates":[1,2,3]}'));
+SELECT 'geomfromgeojson_z_02', ST_AsEWKT(ST_GeomFromGeoJSON('{"type":"LineString","coordinates":[[1,2,3],[2,3,4]]}'));
+
+-- FromGeoJSON 4D
+
+SELECT 'geomfromgeojson_zm_01', ST_AsEWKT(ST_GeomFromGeoJSON('{"type":"Point","coordinates":[1,2,3,4]}'));
+SELECT 'geomfromgeojson_zm_02', ST_AsEWKT(ST_GeomFromGeoJSON('{"type":"LineString","coordinates":[[1,2,3,4],[2,3,4,5]]}'));
+
index 3320f1e25123fe144ebd27cd35a33fb8fb7d5afa..5e10f108419e5ed53163612283843036fe5a59ea 100644 (file)
@@ -7,8 +7,19 @@ geomfromgeojson_06|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)
+ERROR:  unexpected end of data (at offset 0)
+ERROR:  invalid GeoJSON representation
+ERROR:  Too few ordinates in GeoJSON
+ERROR:  Too few ordinates in GeoJSON
+ERROR:  Unable to find 'coordinates' in GeoJSON string
+ERROR:  Unable to find 'coordinates' in GeoJSON string
 #2130|50
 #2216|30
 #2619|POLYGON EMPTY
+#2619|MULTIPOLYGON Z (EMPTY)
 ERROR:  The 'coordinates' in GeoJSON ring are not an array
 ERROR:  The 'coordinates' in GeoJSON ring are not an array
+geomfromgeojson_z_01|POINT(1 2 3)
+geomfromgeojson_z_02|LINESTRING(1 2 3,2 3 4)
+geomfromgeojson_zm_01|POINT(1 2 3)
+geomfromgeojson_zm_02|LINESTRING(1 2 3,2 3 4)