grass
grass copied to clipboard
[Bug] r.reclass: no output + silent with large number of classes in rule
trafficstars
Describe the bug
When trying to reclass a complex land cover map, the module fails silently. No output. No errors. So, my script fails later, as there is no error to catch.
To Reproduce
- Extract
demo.tiff+reclass.txtfrom sample.zip (25KB) - Import
demo.tiffraster ( 414KB ) in axylocation, set region ext based indemolayer r.reclass input=demo output=reclassed rules=reclass.txt
Expected behavior
a ) Correctly reclass b ) In case of failure, throw an error
System description
- Operating System: Linux
5.10.104-linuxkit, macOS12.5.1 - Platform :
aarch64 - GRASS GIS version :
8.0.2(custom compilation for ARM) ,7.6.1(x86 release)
Observation
Seems to fail when the reclass rule has more than 1023 characters
Thanks !
I compiled a version of r.reclass using 102400 in https://github.com/OSGeo/grass/blob/main/raster/r.reclass/main.c#L32 and it seems to be solved. I don't measure the impact of this change. parse.c and input.c have been altered too.