I want to reclassify the same raster several times and then save the file with the value loop variable at the end ... I cannot get it working.
import sys
import os
import atexit
import grass.script as grass
def cleanup():
pass
def main():
for i in range (2,4):
out = "reclasstest" + str(i)
rulesvar = "C:\Grass_data\datareclassfile") + str(i)
grass.run_command("r.reclass",
overwrite = True,
input = "glg@PERMANENT",
output = out,
rules = rulesvar)
return 0
if __name__ == "__main__":
options, flags = grass.parser()
atexit.register(cleanup)
sys.exit(main())