I'm having trouble accessing files from my PERMANENT mapset in the Python code editor inside GRASS.
I am able to access the raster I would like to set my projection to from the console, but for some reason running the equivalent command on the Python code editor reports that the file doesnt exist.
After tracing where the file is in grassdata, I found it to be in the 'grassdata\nc_spm_08_grass7\PERMANENT\windows' directory while my location is set to 'grassdata\nc_spm_08_grass7\lab7'.
I am able to access other rasters that appear in the output of g.list type=raster
from the Python editor but I can't see anything from my PERMANENT mapset. I have also checked that the PERMANENT mapset is accessible.
g.region rural_1m -p
projection: 99 (Lambert Conformal Conic)
zone: 0
datum: nad83
ellipsoid: a=6378137 es=0.006694380022900787
north: 220750
south: 220000
west: 638300
east: 639000
nsres: 1
ewres: 1
rows: 750
cols: 700
cells: 525000
#!/usr/bin/env python3
import grass.script as gscript
def main():
gscript.run_command('g.region', raster='rural_1m', flags='p')
if __name__ == '__main__':
main()
ERROR: Raster map <rural_1m> not found