<div dir="auto"><p dir="ltr">The flow accumulation from r.watershed should go into r.stream.exrract as the input accumulation to calculate a stream raster and flow direction. Then the flow accumulation, flow direction, stream raster, etc should go into r.stream.order.</p><p dir="ltr">From a glance, try one is missing r.stream.extract. Try two is missing r.watershed. See my tutorial here: <a href="https://baharmon.github.io/watersheds-in-grass/#stream-order">https://baharmon.github.io/watersheds-in-grass/#stream-order</a></p><p dir="ltr"><br></p></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 12, 2025, 2:27 AM Maris Nartiss via grass-user <<a href="mailto:grass-user@lists.osgeo.org" target="_blank" rel="noreferrer">grass-user@lists.osgeo.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Please provide also your computational region settings. Could be that<br>
you are simply running out of RAM?<br>
<br>
Māris.<br>
<br>
trešd., 2025. g. 12. marts, plkst. 07:24 — lietotājs Ben Davies via<br>
grass-user (<<a href="mailto:grass-user@lists.osgeo.org" rel="noreferrer noreferrer" target="_blank">grass-user@lists.osgeo.org</a>>) rakstīja:<br>
><br>
> OFFICIAL<br>
><br>
><br>
> Hello<br>
><br>
><br>
><br>
> OS = Win 10<br>
><br>
> GRASS GIS Version 8.3.0 64 Bit<br>
><br>
><br>
><br>
> I am attempting to create a stream classification and have tried the two approaches below.<br>
><br>
><br>
><br>
> Is there something wrong with my approach?<br>
><br>
><br>
><br>
> Try 1<br>
><br>
> gs.run_command('r.fill.dir', input=input_raster, output='fill', direction='flowdir_fill', overwrite=True)<br>
><br>
> gs.run_command('r.watershed', flags='sa', elevation='fill', threshold=500000, basin='raster_basin', accumulation='flowacc', stream='stream_raster_watershed', overwrite=True)<br>
><br>
> gs.run_command('r.stream.order', stream_rast='stream_raster_watershed', direction='flowdir_fill', elevation=input_raster, accumulation='flowacc', stream_vect='stream_vect', strahler='strahler', overwrite=True)<br>
><br>
><br>
><br>
> Try 2<br>
><br>
> gs.run_command('r.fill.dir', input=input_raster, output='fill', direction='flowdir_fill', overwrite=True)<br>
><br>
> gs.run_command('r.stream.extract', elevation=input_raster, threshold=stream_threshold, stream_raster='stream_raster', stream_vector='stream_vector', direction='flowdir_extract', overwrite=True)<br>
><br>
> gs.run_command('r.stream.order', stream_rast='stream_raster_watershed', direction='flowdir_extract', elevation=input_raster, accumulation='flowacc', stream_vect='stream_vect', strahler='strahler', overwrite=True)<br>
><br>
><br>
><br>
><br>
><br>
> The GRASS GIS system returns the following error message to me;<br>
><br>
><br>
><br>
> Traceback (most recent call last):<br>
><br>
>   File<br>
><br>
> "F:\grassdata\hydro\PERMANENT\.tmp\unknown\<a href="http://4728.20.py" rel="noreferrer noreferrer noreferrer" target="_blank">4728.20.py</a>", line<br>
><br>
> 255, in <module><br>
><br>
>     main()<br>
><br>
>   File<br>
><br>
> "F:\grassdata\hydro\PERMANENT\.tmp\unknown\<a href="http://4728.20.py" rel="noreferrer noreferrer noreferrer" target="_blank">4728.20.py</a>", line<br>
><br>
> 217, in main<br>
><br>
>     gs.run_command('r.stream.order',<br>
><br>
>   File "C:\Program Files\GRASS GIS<br>
><br>
> 8.3\etc\python\grass\script\core.py", line 466, in<br>
><br>
> run_command<br>
><br>
>     return handle_errors(returncode, result=None, args=args,<br>
><br>
> kwargs=kwargs)<br>
><br>
>   File "C:\Program Files\GRASS GIS<br>
><br>
> 8.3\etc\python\grass\script\core.py", line 345, in<br>
><br>
> handle_errors<br>
><br>
>     raise CalledModuleError(module=module, code=code,<br>
><br>
> returncode=returncode)<br>
><br>
> grass.exceptions.CalledModuleError: Module run<br>
><br>
> `r.stream.order --o stream_rast=stream_raster_watershed<br>
><br>
> direction=flowdir_extract elevation=dtm-002-004<br>
><br>
> accumulation=flowacc stream_vect=stream_vect<br>
><br>
> strahler=strahler` ended with an error.<br>
><br>
> The subprocess ended with a non-zero return code:<br>
><br>
> 3221225781. See errors above the traceback or in the error<br>
><br>
> output.<br>
><br>
><br>
><br>
> Regards<br>
><br>
> Ben Davies<br>
><br>
><br>
><br>
> ________________________________<br>
> This message is confidential and is intended for the recipient named above. If you are not the intended recipient, you must not disclose, use or copy the message or any part of it. If you received this message in error, please notify the sender immediately by replying to this message, then delete it from your system.<br>
> _______________________________________________<br>
> grass-user mailing list<br>
> <a href="mailto:grass-user@lists.osgeo.org" rel="noreferrer noreferrer" target="_blank">grass-user@lists.osgeo.org</a><br>
> <a href="https://lists.osgeo.org/mailman/listinfo/grass-user" rel="noreferrer noreferrer noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/grass-user</a><br>
_______________________________________________<br>
grass-user mailing list<br>
<a href="mailto:grass-user@lists.osgeo.org" rel="noreferrer noreferrer" target="_blank">grass-user@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/grass-user" rel="noreferrer noreferrer noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/grass-user</a><br>
</blockquote></div>