0

Every time I think I've started to get a very basic handle on QGIS, I get thrown for a loop.

I tried to run r.flow today, and got the following error:

ERROR: Elevation raster map resolution differs from current region resolution

So, upon investigating this, I realize that I'd never set a GRASS region, which is apparently an important thing to do, for reasons i'm still not very clear on, even after reading the man page.

I name my location "grasslocation_test" and my mapset "test_mapset".

So now I have QGIS open, with all my various rasters and vectors still visible, but now I have a Region window open as well. It seems like I need to match my region to my rasters, so I run g.region.multiple.raster, thinking this is the correct tool for the job. Yet I can't select the raster I want to use to bound my region. I tried moving the DEM into the map directory created when I created this new region, thinking maybe that was the problem, and still nothing.

enter image description here

I've googled this to no avail, which makes me feel even sillier since nobody else seems to have been quite as confused by this process as me, but here we are.

1

When you're using GRASS in QGIS, you're essentially using a GIS-within-a-GIS, so you might be using the wrong google search terms. Have you had a a look at this page? https://grass.osgeo.org/gdp/grass5tutor/HTML_en/c515.html

tl;dr, the region defines the nature of any output rasters you generate with GRASS tools. It won't affect the input rasters, just the products.

If you want your raster outputs to have the same extent and cellsize as your DEM, run

g.region rast='yourDEM'

and then take a look at the output of

g.region -p

to see the result. The tool help is here - https://grass.osgeo.org/grass74/manuals/g.region.html

EDIT: you may need to run r.in.gdal to copy your raster into the mapset first.

0

In order to use the g.region modules (as you understood, this is crucial in GRASS) you have to have the rasters imported into your GRASS mapset first. So bring into the GRASS database the rasters you want to use (in the QGIS GRASS Toolbox, under "File management") then you'll be able to select them in the g.region.multi.raster dialog.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.