<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style id="bidiui-paragraph-margins" type="text/css">body p { margin-bottom: 0cm; margin-top: 0pt; } </style>
</head>
<body bidimailui-detected-decoding-type="UTF-8"
bidimailui-charset-is-forced="true" style="direction: ltr;"
text="#933131" bgcolor="#FFFFFF">
<p><br>
</p>
<div class="moz-cite-prefix">On 30/05/2024 15:58, sibylle via
grass-user wrote:<br>
</div>
<blockquote type="cite"
cite="mid:00c401dab291$0b353790$219fa6b0$@gmx.ch">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="Generator"
content="Microsoft Word 15 (filtered medium)">
<style>@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
{mso-style-priority:99;
mso-style-link:"Plain Text Char";
margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-ligatures:standardcontextual;
mso-fareast-language:EN-US;}span.PlainTextChar
{mso-style-name:"Plain Text Char";
mso-style-priority:99;
mso-style-link:"Plain Text";
font-family:"Calibri",sans-serif;}.MsoChpDefault
{mso-style-type:export-only;
font-size:11.0pt;
mso-fareast-language:EN-US;}div.WordSection1
{page:WordSection1;}</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoPlainText">Dear community<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">The main aim is to produce a mask of a
raster file with data > 0</p>
</div>
</blockquote>
<p><br>
</p>
<p>Maybe using r.mapcalc to create the raster mask would be more
appropriate:</p>
<p><font face="monospace">r.mapcalc "MASK = if(ch_apple_presence_total_pollinator_abundance_spring
> 0, 1, null())"</font></p>
<p>After that command completes, all further raster modules will
work only on non-null cells in the MASK raster. You should see the
message "[Raster MASK present]"<br>
</p>
<p>To remove it, you would do: <font face="monospace">r.mask -r</font></p>
<p><font face="monospace"><br>
</font></p>
<p>HTH, Micha<font face="monospace"><br>
</font></p>
<p><font face="monospace"><br>
</font></p>
<blockquote type="cite"
cite="mid:00c401dab291$0b353790$219fa6b0$@gmx.ch">
<div class="WordSection1">
<p class="MsoPlainText"><o:p></o:p></p>
<p class="MsoPlainText">Code:<o:p></o:p></p>
<p class="MsoPlainText">r.mask
raster=ch_apple_presence_total_pollinator_abundance_spring
maskcats="0.01 thru 1"<o:p></o:p></p>
<p class="MsoPlainText"><span
style="background:yellow;mso-highlight:yellow">ERROR: The
raster map
<ch_apple_presence_total_pollinator_abundance_spring>
must be integer (CELL type) in order to use the 'maskcats'
parameter</span><o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Because of the error I followed the help
here:<o:p></o:p></p>
<p class="MsoPlainText"><a
href="https://gis.stackexchange.com/questions/197145/error-in-r-thin-qgis-grass-input-raster-must-be-of-type-cell"
moz-do-not-send="true" class="moz-txt-link-freetext">https://gis.stackexchange.com/questions/197145/error-in-r-thin-qgis-grass-input-raster-must-be-of-type-cell</a><o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">However, wen running the code suggested
with gdal_translate, I got an error<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">gdal_translate -co
"ch_apple_presence_total_pollinator_abundance_spring "
ch_apple_presence_total_pollinator_abundance_spring.tif bit_
ch_apple_presence_total_pollinator_abundance_spring.tif<o:p></o:p></p>
<p class="MsoPlainText">r.null
map=ch_apple_presence_total_pollinator_abundance_spring
setnull=1<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">gdal_translate -co
ch_apple_presence_total_pollinator_abundance_spring
ch_apple_presence_total_pollinator_abundance_spring.tif bit_
ch_apple_presence_total_pollinator_abundance_spring.tif<o:p></o:p></p>
<p class="MsoPlainText"><span
style="background:yellow;mso-highlight:yellow">ERROR 6: Too
many command options</span><o:p></o:p></p>
<p class="MsoPlainText">'ch_apple_presence_total_pollinator_abundance_spring.tif'<o:p></o:p></p>
<p class="MsoPlainText">Usage: gdal_translate [--help]
[--help-general] [--long-<o:p></o:p></p>
<p class="MsoPlainText">usage]<o:p></o:p></p>
<p class="MsoPlainText"> [-ot
{Byte/Int8/Int16/UInt16/UInt32/Int32/UInt64/Int6<o:p></o:p></p>
<p class="MsoPlainText">4/Float32/Float64/<o:p></o:p></p>
<p class="MsoPlainText">
CInt16/CInt32/CFloat32/CFloat64}] [-strict]<o:p></o:p></p>
<p class="MsoPlainText"> [-if <format>]... [-of
<format>]<o:p></o:p></p>
<p class="MsoPlainText"> [-b <band>] [-mask
<band>] [-expand {gray|rgb|rgba}]<o:p></o:p></p>
<p class="MsoPlainText"> [-outsize <xsize>[%]|0
<ysize>[%]|0] [-tr <xres><o:p></o:p></p>
<p class="MsoPlainText"><yres>]<o:p></o:p></p>
<p class="MsoPlainText"> [-ovr
<level>|AUTO|AUTO-<n>|NONE]<o:p></o:p></p>
<p class="MsoPlainText"> [-r<o:p></o:p></p>
<p class="MsoPlainText">{nearest,bilinear,cubic,cubicspline,lanczos,average,mode}]<o:p></o:p></p>
<p class="MsoPlainText"> <span lang="FR-CH">[-unscale]
[-scale[_bn] [<src_min> <src_max><o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="FR-CH">[<dst_min>
<dst_max>]]]... [-exponent[_bn] <exp_val>]...<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="FR-CH"> </span>[-srcwin
<xoff> <yoff> <xsize> <ysize>] [-epo]
[-eco]<o:p></o:p></p>
<p class="MsoPlainText"> [-projwin <ulx> <uly>
<lrx> <lry>] [-projwin_srs<o:p></o:p></p>
<p class="MsoPlainText"><srs_def>]<o:p></o:p></p>
<p class="MsoPlainText"> [-a_srs <srs_def>]
[-a_coord_epoch <epoch>]<o:p></o:p></p>
<p class="MsoPlainText"> [-a_ullr <ulx> <uly>
<lrx> <lry>] [-a_nodata <value>]<o:p></o:p></p>
<p class="MsoPlainText"> <span lang="FR-CH">[-a_gt
<gt0> <gt1> <gt2> <gt3> <gt4>
<gt5>]<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="FR-CH"> </span>[-a_scale
<value>] [-a_offset <value>]<o:p></o:p></p>
<p class="MsoPlainText"> [-nogcp] [-gcp <pixel>
<line> <easting> <northing><o:p></o:p></p>
<p class="MsoPlainText">[<elevation>]]...<o:p></o:p></p>
<p class="MsoPlainText"> |-colorinterp{_bn}<o:p></o:p></p>
<p class="MsoPlainText">{red|green|blue|alpha|gray|undefined}]<o:p></o:p></p>
<p class="MsoPlainText"> |-colorinterp<o:p></o:p></p>
<p class="MsoPlainText">{red|green|blue|alpha|gray|undefined},...]<o:p></o:p></p>
<p class="MsoPlainText"> [-mo
<META-TAG>=<VALUE>]... [-q] [-sds]<o:p></o:p></p>
<p class="MsoPlainText"> [-co
<NAME>=<VALUE>]... [-stats] [-norat] [-noxmp]<o:p></o:p></p>
<p class="MsoPlainText"> [-oo
<NAME>=<VALUE>]...<o:p></o:p></p>
<p class="MsoPlainText"> <src_dataset>
<dst_dataset><o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Thanks a lot<o:p></o:p></p>
<p class="MsoPlainText">Sibylle <o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
</div>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
grass-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/grass-user">https://lists.osgeo.org/mailman/listinfo/grass-user</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
Micha Silver
Ben Gurion Univ.
Sde Boker, Remote Sensing Lab
cell: +972-523-665918</pre>
</body>
</html>