I'm having trouble with a simple script in Python. I do not know where the error is. I use GRASS 8.0.
import os
import math
import grass.script as grass
elevation = 'dem_10_fill'
elev_new = 'elevation_mod'
grass.run_command('g.region', raster=elevation)
grass.mapcalc('elev_new = if(elevation < 280, elevation)')
The message is:
Niewłaściwa mapa elevation / Incorrect elevation map
Parse error
ERROR: parse error
ERROR: An error occurred while running r.mapcalc with expression: elev_new = if(elevation < 280, elevation)