<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>Am 24.03.2011 um 07:34 schrieb Hamish:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Johannes wrote:</div><blockquote type="cite"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I think r.mapcalc is probably the best solution, but as I don't know</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">the maximum value in every case (I've to process several maps), I wanted</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">to automatize. Probably I've to write a script to read the max value and</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">parse it to the mapcalc function.</div></blockquote><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">g.mlist + 'r.info -r' in a loop.</div></blockquote><div><br></div><div>I thought more about the pipe command in python like:</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; line-height: 12px; "><font face="Courier" size="2" style="font: normal normal normal 10px/normal Courier; ">p&nbsp;</font><font face="Courier" size="2" color="#85c76c" style="font: normal normal normal 10px/normal Courier; color: rgb(133, 199, 108); ">=</font><font face="Courier" size="2" style="font: normal normal normal 10px/normal Courier; ">&nbsp;grass.pipe_command(</font><font face="Courier" size="2" color="#454087" style="font: normal normal normal 10px/normal Courier; color: rgb(69, 64, 135); ">'r.stats'</font><font face="Courier" size="2" color="#85c76c" style="font: normal normal normal 10px/normal Courier; color: rgb(133, 199, 108); ">,</font><font face="Courier" size="2" style="font: normal normal normal 10px/normal Courier; ">flags</font><font face="Courier" size="2" color="#85c76c" style="font: normal normal normal 10px/normal Courier; color: rgb(133, 199, 108); ">=</font><font face="Courier" size="2" color="#454087" style="font: normal normal normal 10px/normal Courier; color: rgb(69, 64, 135); ">'c'</font><font face="Courier" size="2" color="#85c76c" style="font: normal normal normal 10px/normal Courier; color: rgb(133, 199, 108); ">,</font><font face="Courier" size="2" color="#3b7c17" style="font: normal normal normal 10px/normal Courier; color: rgb(59, 124, 23); ">input</font><font face="Courier" size="2" color="#85c76c" style="font: normal normal normal 10px/normal Courier; color: rgb(133, 199, 108); ">=</font><font face="Courier" size="2" color="#454087" style="font: normal normal normal 10px/normal Courier; color: rgb(69, 64, 135); ">'map'</font><font face="Courier" size="2" style="font: normal normal normal 10px/normal Courier; ">)</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; line-height: 12px; "><font face="Courier" size="2" style="font: normal normal normal 10px/normal Courier; ">&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;result&nbsp;</font><font face="Courier" size="2" color="#85c76c" style="font: normal normal normal 10px/normal Courier; color: rgb(133, 199, 108); ">=</font><font face="Courier" size="2" style="font: normal normal normal 10px/normal Courier; ">&nbsp;{}</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; line-height: 12px; "><font face="Courier" size="2" style="font: normal normal normal 10px/normal Courier; ">&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;</font><font face="Courier" size="2" color="#e47b23" style="font: normal normal normal 10px/normal Courier; color: rgb(228, 123, 35); "><b>for</b></font><font face="Courier" size="2" style="font: normal normal normal 10px/normal Courier; ">&nbsp;line&nbsp;</font><font face="Courier" size="2" color="#e47b23" style="font: normal normal normal 10px/normal Courier; color: rgb(228, 123, 35); "><b>in</b></font><font face="Courier" size="2" style="font: normal normal normal 10px/normal Courier; ">&nbsp;p.stdout:</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; line-height: 12px; "><font face="Courier" size="2" style="font: normal normal normal 10px/normal Courier; ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;val</font><font face="Courier" size="2" color="#85c76c" style="font: normal normal normal 10px/normal Courier; color: rgb(133, 199, 108); ">,</font><font face="Courier" size="2" style="font: normal normal normal 10px/normal Courier; ">count&nbsp;</font><font face="Courier" size="2" color="#85c76c" style="font: normal normal normal 10px/normal Courier; color: rgb(133, 199, 108); ">=</font><font face="Courier" size="2" style="font: normal normal normal 10px/normal Courier; ">&nbsp;line.strip().split()</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; line-height: 12px; "><font face="Courier" size="2" style="font: normal normal normal 10px/normal Courier; ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;result[</font><font face="Courier" size="2" color="#3b7c17" style="font: normal normal normal 10px/normal Courier; color: rgb(59, 124, 23); ">int</font><font face="Courier" size="2" style="font: normal normal normal 10px/normal Courier; ">(val)]&nbsp;</font><font face="Courier" size="2" color="#85c76c" style="font: normal normal normal 10px/normal Courier; color: rgb(133, 199, 108); ">=</font><font face="Courier" size="2" style="font: normal normal normal 10px/normal Courier; ">&nbsp;</font><font face="Courier" size="2" color="#3b7c17" style="font: normal normal normal 10px/normal Courier; color: rgb(59, 124, 23); ">int</font><font face="Courier" size="2" style="font: normal normal normal 10px/normal Courier; ">(count)</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; line-height: 12px; "><font face="Courier" size="2" style="font: normal normal normal 10px/normal Courier; ">&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;p.wait()</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; line-height: 12px; "><font face="Courier" size="2" style="font: normal normal normal 10px/normal Courier; "><br></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; line-height: 12px; "><font class="Apple-style-span" face="Courier" size="2"><span class="Apple-style-span" style="font-size: 10px; line-height: normal; "><span class="Apple-style-span" style="font-family: Helvetica; font-size: medium; ">&nbsp;but in combination with r.info to read the max value, but I don't know yet how&nbsp;</span></span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; line-height: 12px; "><font class="Apple-style-span" face="Courier" size="2"><span class="Apple-style-span" style="font-size: 10px; line-height: normal; "><span class="Apple-style-span" style="font-family: Helvetica; font-size: medium; ">to realize it (the code in the for loop of p.stdout).</span></span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; line-height: 12px; "><font class="Apple-style-span" face="Courier" size="2"><span class="Apple-style-span" style="font-size: 10px; line-height: normal; "><span class="Apple-style-span" style="font-family: Helvetica; font-size: medium; "><br></span></span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; line-height: 12px; "><font class="Apple-style-span" face="Courier" size="2"><span class="Apple-style-span" style="font-size: 10px; line-height: normal; "><span class="Apple-style-span" style="font-family: Helvetica; font-size: medium; ">maybe someone has an idea...</span></span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; line-height: 12px; "><font class="Apple-style-span" face="Courier" size="2"><span class="Apple-style-span" style="font-size: 10px; line-height: normal; "><span class="Apple-style-span" style="font-family: Helvetica; font-size: medium; "><br></span></span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; line-height: 12px; "><font class="Apple-style-span" face="Courier" size="2"><span class="Apple-style-span" style="font-size: 10px; line-height: normal; "><span class="Apple-style-span" style="font-family: Helvetica; font-size: medium; ">cheers</span></span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; line-height: 12px; "><font class="Apple-style-span" face="Courier" size="2"><span class="Apple-style-span" style="font-size: 10px; line-height: normal; "><span class="Apple-style-span" style="font-family: Helvetica; font-size: medium; ">/johannes</span></span></font></div></div><div><br></div><br><blockquote type="cite"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Hamish</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">grass-user mailing list</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><a href="http://lists.osgeo.org/mailman/listinfo/grass-user">http://lists.osgeo.org/mailman/listinfo/grass-user</a></div></blockquote></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br></div></div></body></html>