#In response to @Micha's answer:
I have put everything into a shell script as suggested, and indeed it is much cleaner. This is the script as it stands now:
r.external -o input=/data/paths.TIFF output=dummy_img
g.region -ap raster=dummy_img
#r.reclass input=dummy_img output=dummy_img_nulled rules=/data/reclass_rules.txt
r.null map=dummy_img setnull=0
#r.thin input=dummy_img_nulled output=thinned
r.thin input=dummy_img output=thinned
r.to.vect thinned output=vectorized type=line
v.out.ogr input=vectorized output=/data/out/out_lines2.shp format=ESRI_Shapefile --overwrite
But now it seems to segfault when I run r.null map=dummy_img setnull=0
. You can see in the commented lines that I have come up with a patch solution by using r.reclass
to just mimic the intended effect of r.null
, but I still find it odd that r.null
is giving me such grief with this