I think r.mapcalc is probably the best solution, but as I don't know
the maximum value in every case (I've to process several maps), I wanted
to automatize. Probably I've to write a script to read the max value and
parse it to the mapcalc function.
I think r.mapcalc is probably the best solution, but as I don’t know
the maximum value in every case (I’ve to process several maps), I wanted
to automatize. Probably I’ve to write a script to read the max value and
parse it to the mapcalc function.
g.mlist + ‘r.info -r’ in a loop.
I thought more about the pipe command in python like:
p = grass.pipe_command(‘r.stats’,flags=‘c’,input=‘map’)
result = {} for line in p.stdout:
val,count = line.strip().split()
result[int(val)] = int(count)
p.wait()
but in combination with r.info to read the max value, but I don’t know yet how
to realize it (the code in the for loop of p.stdout).