[GRASS-user] Add-Ons and batch job with the --exec interface

Micha Silver tsvibar at gmail.com
Sun Dec 20 03:17:20 PST 2020


On 12/20/20 1:01 PM, Vincent Bain wrote:
> Hi dear Grass users,
>
> I'm wondering how/if one can run an Add-On command while invoking grass
> from the --exec interface.
>
> As an example, if I run :
>
>     grass79 /path/to/my/location/mapset --exec g.list rast
>
> I succeed.
>
> As well as checking my GRASS_ADDON_PATH :


Maybe it should be GRASS_ADDON_BASE.


micha at RMS:~$ env | grep ADDON
GRASS_ADDON_BASE=/home/micha/.grass7/addons/


Now before initializing GRASS:


micha at RMS:~$ export GRASS_ADDON_BASE=/home/micha/.grass7/addons/
micha at RMS:~$ grass /home/micha/GIS/grass/ITM/Arava/ --exec r.stream.order
Starting GRASS GIS...
Cleaning up temporary files...
Executing <r.stream.order> ...
Calculates Strahler's and more streams hierarchy.

Usage:
  r.stream.order [-zma] stream_rast=name direction=name [elevation=name]
    [accumulation=name] [stream_vect=name] [strahler=name] [horton=name]
    [shreve=name] [hack=name] [topo=name] [memory=value] [--overwrite]
    [--help] [--verbose] [--quiet] [--ui]

Flags:
   -z   Create zero-valued background instead of NULL
   -m   Use memory swap (operation is slow)
   -a   Use flow accumulation to trace horton and hack models

Parameters:
    stream_rast   Name of input raster map with stream network
      direction   Name of input flow direction raster map
      elevation   Name of input elevation raster map
   accumulation   Name of input accumulation raster map
    stream_vect   Name for output vector map to write stream attributes
       strahler   Name for output Strahler's stream order raster map
         horton   Name for output original Hortons's stream order raster map
         shreve   Name for output Shereve's stream magnitude raster map
           hack   Name for output Hack's streams or Gravelius stream 
hierarchy raster map
           topo   Name for output topological dimension of streams 
raster map
         memory   Max memory used in memory swap mode (MB)
                  default: 300
Execution of <r.stream.order> finished.
Cleaning up default sqlite database ...
Cleaning up temporary files...


>
>     echo $GRASS_ADDON_PATH
>     /usr/local/grass-addons/
>
>     But :
>
>     grass79 /path/to/my/location/mapset --exec r.my.addon
>
>     fails :
>
>     [Errno 2] No such file or directory: 'r.my.addon': 'r.my.addon'
>     Exiting...
>
>
>     Would anyone help me solve this issue ?
>     Have a nice sunday,
>
>     Vincent.
>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user

-- 
Micha Silver
Ben Gurion Univ.
Sde Boker, Remote Sensing Lab
cell: +972-523-665918



More information about the grass-user mailing list