I'm struggling to make sense of the grass command line syntax for specifying a raster geotif as an input parameter for a watershed analysis using a DEM tif. I may also have the user folder setup, database, mapsets completely wrong too. The commands are to be run from the CMD in windows 10 using GRASS 7.6.
My command:
grass76 --text C:\Temp\grass\newLocation\PERMANENT --exec r.watershed -s elevation="C:\Temp\grass\database\dem.tif" threshold=10000
Message:
Starting GRASS GIS...
WARNING: Concurrent mapset locking is not supported on Windows
Executing <r.watershed -s elevation=C:\Temp\grass\database\dem.tif threshold=10000> ...
SECTION 1a (of 5): Initiating Memory.
ERROR: Raster map <C:\Temp\grass\database\dem.tif> not found
WARNING: Subprocess failed with exit code 1
Execution of <r.watershed -s elevation=C:\Temp\grass\database\dem.tif threshold=10000> finished.
Cleaning up temporary files...
Press any key to continue . . .
I've tried without " around the filepath, with forward slashes, within <>.
I've copied the dem.tif to all the folders: 'C:\Temp\grass\newLocation', 'C:\Temp\grass\newLocation\command', 'C:\Temp\grass\newLocation\PERMANENT', 'C:\Temp\grass\database'
Any obvious syntax problems?
It seems like the --exec is successfully recognising I want to run a command put claims there is a raster file path or file access issue...
I want to avoid any setting up of a GRASS GIS Database directory, GRASS Location or a Mapset...whatever that is.
I just want to be able to run GRASS commands from the command prompt - in reality probably automated via python and subprocess and to change to input parameters such as the data source and output files. So I would prefer to do that via within the command itself. I want to avoid user input of setting up an environment.
Is that possible?
Have I mucked up the setup which is causing issues? (I set EPSG of 27700 when creating the user folder).