- #4437, Handle POINT EMPTY in shape loader/dumper (Paul Ramsey)
- #4461, ST_AsTWKB doesn't always remove duplicate points (Nik Aven)
- #4459, Fix ST_Subdivide crash on intermediate EMPTY (Darafei Praliaskouski)
-
+ - #4470, ST_GeomFromGeoJSON crash on empty rings (Darafei Praliaskouski)
PostGIS 2.5.2
}
nPoints = json_object_array_length(points);
- /* Skip empty rings */
- if ( nPoints == 0 ) continue;
-
if ( ! ppa )
ppa = (POINTARRAY**)lwalloc(sizeof(POINTARRAY*) * nRings);
-- #4164
SELECT ST_AsText(ST_GeomFromGeoJSON('{"type": "Polygon", "coordinates": [[0,0],[0,5],[5, 5],[5,0],[0,0]]}'));
+SELECT '#4470.a', ST_AsText(ST_GeomFromGeoJSON('{"type":"Polygon","coordinates":[[[0,0]],[]]}'));
+SELECT '#4470.b', ST_AsText(ST_GeomFromGeoJSON('{"type":"Polygon","coordinates":[[],[0,0]]}'));
+SELECT '#4470.c', ST_AsText(ST_GeomFromGeoJSON('{"type":"MultiPolygon","coordinates":[[[[0,0]],[]]]}'));
+SELECT '#4470.d', ST_AsText(ST_GeomFromGeoJSON('{"type":"MultiPolygon","coordinates":[[[],[0,0]]]}'));
geomfromgeojson_srs_4|GEOMETRYCOLLECTION(POINT(100 0),LINESTRING(101 0,102 1))
#3583|MULTIPOLYGON Z (EMPTY)
ERROR: The 'coordinates' in GeoJSON polygon are not sufficiently nested
+#4470.a|POLYGON((0 0),())
+ERROR: The 'coordinates' in GeoJSON polygon are not sufficiently nested
+#4470.c|MULTIPOLYGON(((0 0),()))
+#4470.d|MULTIPOLYGON Z (EMPTY)