While performing actions in python console as described in the module of GRASS GIS,am getting following error:
import grass.script as gs
r.in.gdal -e input="D:...\ASTGTMV003_N19E073_dem" output=DEM
File "", line 1
r.in.gdal -e input="D:\...\ASTGTMV003_N19E073_dem" output=DEM
^
SyntaxError: invalid syntax
Then I gave input from import raster and was able to view my DEM tile in GUI but the next actions gave me other errors.
gs.run_command('g.region', raster='elevation')
Traceback (most recent call last):
File "", line 1, in
File "C:\OSGEO4~1\apps\grass\grass78\etc\python\grass\script\core.py", line 441, in run_command return handle_errors(returncode, returncode, args, kwargs)
File "C:\OSGEO4~1\apps\grass\grass78\etc\python\grass\script\core.py", line 343, in handle_errors returncode=returncode)
grass.exceptions.CalledModuleError: Module run None g.region raster=elevation ended with error
Process ended with non-zero return code 1. See errors in the (error) output.
s.run_command('r.neighbors', input='elevation', output='elev_smoothed', method='average', flags='c')
Traceback (most recent call last):
File "", line 1, in
File "C:\OSGEO4~1\apps\grass\grass78\etc\python\grass\script\core.py", line 441, in run_command return handle_errors(returncode, returncode, args, kwargs)
File "C:\OSGEO4~1\apps\grass\grass78\etc\python\grass\script\core.py", line 343, in handle_errors returncode=returncode)
grass.exceptions.CalledModuleError: Module run None r.neighbors -c input=elevation output=elev_smoothed method=average ended with error
Process ended with non-zero return code 1. See errors in the (error) output.