Am 24.03.2011 um 07:34 schrieb Hamish:

Johannes wrote:
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).

maybe someone has an idea...

cheers
/johannes




Hamish




_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Reply via email to