Access GRASS 7 data in QGIS

QGIS supports GRASS in two different ways. 1) For those working with GRASS databases, there is the GRASS toolbox, which basically offered an alternative GUI to GRASS. For those working with other data types, most GRASS functions are now available through the processing toolbox.

I do most of my spatial analysis in GRASS, while I use QGIS amongst others to create maps based on the results. So I mostly used the GRASS toolbox. Unfortunately, the GRASS toolbox doesn’t work (yet) in QGIS 2.6. So what now? Well, as it turns out, QGIS can access GRASS raster layers through the QGIS browser.

Open the QGIS browser
Open the QGIS browser

And browse to the folder with your GRASS Database, where you can select the desired layer (vector or raster layer). It only provides read access, so not editing or saving layers back to GRASS. For my purposes, creating maps for in publications, this is good enough. If I want to edit maps, I just go back to GRASS. Or if I want to do some specific analysis not available in GRASS, I save the layer in another format, and open that one in QGIS.

Screenshot from 2014-11-21 18:39:23
A vector and raster layer from my GRASS database opened in QGIS

I am actually not sure for how long this feature has been around. I hadn’t managed to compile GDAL with GRASS support (a prerequisite for QGIS to be able to see GRASS data) after I switched to GRASS 7. But I finally managed using the three step approach: 1) compile GDAL without GRASS support; 2) Compile GRASS; 3) Compile GDAL again, but this time with GRASS support.

For the curious, this three step approach is needed to deal with the circular dependencies (GRASS depend on GDAL, GDAL depend on GRASS). There is a potentially easier alternative; the GDAL-GRASS plugin, but I haven’t been able to get that to work with GRASS 7.

Anyway, this work, great!


3 thoughts on “Access GRASS 7 data in QGIS

  1. Pingback: The QGIS GRASS plugin is back | Ecostudies

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s