<div dir="ltr">Hi Everyone <div><br></div><div> Thanks for your response, for some reason it works now.</div><div><br></div><div>Thanks</div><div>Ming</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Micha Silver <<a href="mailto:tsvibar@gmail.com">tsvibar@gmail.com</a>> 于2020年11月17日周二 上午10:44写道:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div style="direction:ltr">
<p><br>
</p>
<div>On 11/17/20 6:03 AM, ming han wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">Hi Everyone
<div> </div>
<div> Hope this email finds you well. </div>
<div> I can run r.cross in console with following command: </div>
<div> "r.cross -z --overwrite --quiet
input=Connect_Lake@PERMANENT,str_grass_r@PERMANENT
output=test"</div>
<div> </div>
<div> But I got error by run r.cross in python with following
command: </div>
<div> grass.run_command('r.cross', input =
['str_grass_r@PERMANENT','Connect_Lake@PERMANENT'],output =
'test', quiet = True)</div>
<div><br>
</div>
<div> What is the correct format to use r.cross function in
Python? and how to obtain the output table generated by
r.cross? <br>
</div>
</div>
</blockquote>
<p><br>
</p>
<p><font size="+1">This worked fine for me also, using GRASS 7.8.4
in the nc_basin_spm LOCATION:</font></p>
<p><tt><br>
</tt></p>
<p><tt>In [2]: import grass.script as gscript</tt><tt><br>
</tt><tt><br>
</tt><tt>In [3]: gscript.run_command("r.cross",
input=["landuse@PERMANENT","basins@PERMANENT"], output="lu_bas",
overwrite=True)</tt><tt><br>
</tt><tt>r.cross: STEP 1 ...</tt><tt><br>
</tt><tt> 100%</tt><tt><br>
</tt><tt>r.cross: STEP 2 ...</tt><tt><br>
</tt><tt>r.cross: STEP 3 ...</tt><tt><br>
</tt><tt> 100%</tt><tt><br>
</tt><tt>Creating support files for <lu_bas>...</tt><tt><br>
</tt><tt>89 categories</tt><tt><br>
</tt><tt>Out[3]: 0</tt></p>
<p><font size="+1"><br>
</font></p>
<p><font size="+1">Just to be clear, you do not get a table output,
rather a raster. In your case you should see a new raster
"test".</font></p>
<p><font size="+1"></font><br>
</p>
<blockquote type="cite">
<div dir="ltr">
<div><br>
</div>
<div>Thanks</div>
<div>Ming</div>
</div>
<br>
<fieldset></fieldset>
<pre>_______________________________________________
grass-user mailing list
<a href="mailto:grass-user@lists.osgeo.org" target="_blank">grass-user@lists.osgeo.org</a>
<a href="https://lists.osgeo.org/mailman/listinfo/grass-user" target="_blank">https://lists.osgeo.org/mailman/listinfo/grass-user</a></pre>
</blockquote>
<pre cols="72">--
Micha Silver
Ben Gurion Univ.
Sde Boker, Remote Sensing Lab
cell: +972-523-665918</pre>
</div>
</blockquote></div>