<html style="direction: ltr;">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">body p { margin-bottom: 0cm; margin-top: 0pt; } </style>
</head>
<body bidimailui-charset-is-forced="true" style="direction: ltr;"
text="#000000" bgcolor="#FFFFFF">
<br>
<br>
<div class="moz-cite-prefix">On 07/11/2018 02:20 AM, Gabriel Cotlier
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAAKwTDGg3ge=OYtwPZHmKDGA2yBci5p1FDGNRxiW_3aaANA_fQ@mail.gmail.com">
<div dir="ltr">
<div>Dear grass users,<br>
</div>
<div><br>
</div>
<div>I'm using grass 7.4.1 trying to export all raster layers
in the current mapset out of grass to a folder
as GeoTiff files though a for loop from the python shell as
follows and I'm getting the error in red... <br>
</div>
<div>What could be the problem?<br>
</div>
<div>Thanks a lot in advance.</div>
<div>Regards,</div>
<div>Gabriel<br>
</div>
<div><br>
</div>
<div>>>>import grass.script as gscript<br>
>>>rastlist=grass.read_command("g.list",type="rast")<br>
>>>rastlist<br>
F121996<br>
F121997<br>
F141999<br>
F142000<br>
</div>
</div>
</blockquote>
<br>
Try:<br>
<tt>rastlist=grass.read_command("g.list",type="rast").split()<br>
<br>
</tt>
<blockquote type="cite"
cite="mid:CAAKwTDGg3ge=OYtwPZHmKDGA2yBci5p1FDGNRxiW_3aaANA_fQ@mail.gmail.com">
<div dir="ltr">
<div><br>
>>>os.chdir('C:\\Users\\Gabriel\\Desktop\\out')<br>
None<br>
>>>for raster in rastlist:<br>
... gscript.run_command('r.out.gdal', input=raster,<br>
... output=raster
+ '.tiff', format='GTiff')<br>
<br>
<span style="color:rgb(255,0,0)">Traceback (most recent call
last):<br>
File "<input>", line 3, in <module><br>
File
"C:\OSGEO4~1\apps\grass\grass-7.4.1\etc\python\grass\script\core.py",
line 421, in run_command<br>
return handle_errors(returncode, returncode, args,
kwargs)<br>
File
"C:\OSGEO4~1\apps\grass\grass-7.4.1\etc\python\grass\script\core.py",
line 332, in handle_errors<br>
returncode=returncode)<br>
CalledModuleError: Module run None ['r.out.gdal', 'input=F',
'output=F.tiff', 'format=GTiff'] ended with error<br>
Process ended with non-zero return code 1. See errors in the
(error) output.</span><br>
</div>
</div>
<!--'"--><br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<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>
<br>
<pre class="moz-signature" cols="72">--
Micha Silver
Ben Gurion Univ.
Sde Boker, Remote Sensing Lab
cell: +972-523-665918</pre>
</body>
</html>