raster2polygon: json.decoder.JSONDecodeError: Expecting ',' delimiter: line 6 column 736645 (char 736802)
Fails with GDAL 3.8.5:
test_conversion.py::Test_raster2polygon::test_mask_large
============================== 1 failed in 10.82s ==============================
Polygonize progress |==================================================| 100.0% Complete => 0:00:01
FAILED
tests/test_geo/test_raster/test_conversion.py:86 (Test_raster2polygon.test_mask_large)
self = <tests.test_geo.test_raster.test_conversion.Test_raster2polygon testMethod=test_mask_large>
def test_mask_large(self):
> poly = raster2polygon(self.mask_l, self.gt_l, self.prj_l, exact=False, min_npx=1)
test_conversion.py:88:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../../py_tools_ds/geo/raster/conversion.py:168: in raster2polygon
gjs = json.loads(content_str)
/home/gfz-fe/mambaforge/envs/arosics_py312/lib/python3.12/json/__init__.py:346: in loads
return _default_decoder.decode(s)
/home/gfz-fe/mambaforge/envs/arosics_py312/lib/python3.12/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <json.decoder.JSONDecoder object at 0x7fd2e1800530>
s = '{\n"type": "FeatureCollection",\n"name": "polygonize_result",\n"crs": { "type": "name", "properties": { "name": "urn:...08 ], [ 393225.385366580099799, 5178174.241844421252608 ], [ 393225.385366580099799, 5178174.315920990891755 ] ] ] } }'
idx = 0
def raw_decode(self, s, idx=0):
"""Decode a JSON document from ``s`` (a ``str`` beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in ``s`` where the document ended.
This can be used to decode a JSON document from a string that may
have extraneous data at the end.
"""
try:
> obj, end = self.scan_once(s, idx)
E json.decoder.JSONDecodeError: Expecting ',' delimiter: line 6 column 736645 (char 736802)
/home/gfz-fe/mambaforge/envs/arosics_py312/lib/python3.12/json/decoder.py:353: JSONDecodeError
swig/python detected a memory leak of type 'GDALDatasetShadow *', no destructor found.
Process finished with exit code 1