@@ -3941,6 +3941,37 @@ def test_ogr_geojson_starting_with_geometry_coordinates(tmp_vsimem):
3941
3941
assert ds is not None
3942
3942
3943
3943
3944
+ ###############################################################################
3945
+ # Test fix for https://github.com/qgis/QGIS/issues/61266
3946
+
3947
+
3948
+ @pytest .mark .parametrize (
3949
+ "start,end" ,
3950
+ [
3951
+ ('{"type":"Point","coordinates":[' , "2,49]}" ),
3952
+ ('{"type":"LineString","coordinates":[[' , "2,49],[3,50]]}" ),
3953
+ ('{"type":"Polygon","coordinates":[[[' , "0,0],[0,1],[1,1],[0,0]]]}" ),
3954
+ ('{"type":"MultiPoint","coordinates":[[' , "2,49]]}" ),
3955
+ ('{"type":"MultiLineString","coordinates":[[[' , "2,49],[3,50]]]}" ),
3956
+ ('{"type":"MultiPolygon","coordinates":[[[[' , "0,0],[0,1],[1,1],[0,0]]]]}" ),
3957
+ ('{"type":"GeometryCollection","geometries":[' , "]}" ),
3958
+ ],
3959
+ )
3960
+ def test_ogr_geojson_starting_with_geometry_type (tmp_vsimem , start , end ):
3961
+
3962
+ tmpfilename = tmp_vsimem / "temp.json"
3963
+ gdal .FileFromMemBuffer (
3964
+ tmpfilename ,
3965
+ '{ "geometry":'
3966
+ + start
3967
+ + (" " * 10000 )
3968
+ + end
3969
+ + ', "type":"Feature","properties":{}}' ,
3970
+ )
3971
+ ds = gdal .OpenEx (tmpfilename , gdal .OF_VECTOR )
3972
+ assert ds is not None
3973
+
3974
+
3944
3975
###############################################################################
3945
3976
# Test serialization of Float32 values
3946
3977
0 commit comments