<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class="">Hi Moritz,</div><div class="">How about this:</div><div class=""><br class=""></div><span class=""><font face="Menlo" class="">info = grass.parse_command('r.univar', map=</font></span><span style="font-family: Menlo;" class="">'</span><span class=""><font face="Menlo" class="">raster_xyz', flags='g</font></span><span style="font-family: Menlo;" class="">'</span><span class=""><font face="Menlo" class="">)</font></span><div class=""><span class=""><font face="Menlo" class="">print(int(info[</font></span><span style="font-family: Menlo;" class="">'</span><span style="font-family: Menlo;" class="">n</span><span style="font-family: Menlo;" class="">'</span><span style="font-family: Menlo;" class="">]), </span><font face="Menlo" class="">int(info[</font><span style="font-family: Menlo;" class="">'</span><span style="font-family: Menlo;" class="">null_cells</span><span style="font-family: Menlo;" class="">'</span><span style="font-family: Menlo;" class="">]))</span></div><div class=""><span style="font-family: Menlo;" class=""><br class=""></span></div><div class=""><span style="font-family: Menlo;" class="">Michel</span></div><div class=""><span class=""><br class=""></span>
<div><br class=""><blockquote type="cite" class=""><div class="">On 19 Oct 2018, at 15:36, Moritz Lennert <<a href="mailto:mlennert@club.worldonline.be" class="">mlennert@club.worldonline.be</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Hi all,<br class=""><br class="">What would be the quickest way to test whether a raster contains any non-null values in the current computational region ?<br class=""><br class="">And the correlary: what would be the quickest way to test whether a raster contains any null values in the current computational region ?<br class=""><br class="">This will be applied in Python, so if there are any special Python functions, these are welcome, too.<br class=""><br class="">Moritz<br class="">_______________________________________________<br class="">grass-dev mailing list<br class=""><a href="mailto:grass-dev@lists.osgeo.org" class="">grass-dev@lists.osgeo.org</a><br class="">https://lists.osgeo.org/mailman/listinfo/grass-dev</div></div></blockquote></div><br class=""></div></body></html>