Unit 07 - QGIS loves GRASS

Let’s step out of the GRASS GIS environment for a moment. QGIS is a very popular open source GIS package which made a significant progress in the last years. Nowadays it’s used in education, academic environment, but also in commercial settings. In 2002 QGIS started a multiplatform viewer for geospatial data. In the recent years QGIS made important steps for being analytical tool. Beside native algoritms QGIS offers also connection to third-party software packages as SAGA, Orfeo or GRASS GIS. GRASS tools can be run directly from QGIS enviroment without starting GRASS explicitly.

Data produced by GRASS GIS may be easily accessed directly from Browser tab.

../_images/qgis-display-grass-data.png

Fig. 42 Show data produced by GRASS GIS in QGIS environment.

Note

QGIS has some issues with GRASS raster data symbology. Broken symbology may be fixed in Properties dialog.

../_images/qgis-raster-symbology.png

Fig. 43 Set raster symbology in QGIS.

It is also possible to run GRASS tools from Processing plugin.

Let’s compute NDVI as described in Unit 05 - Raster processing using i.vi GRASS tool, but in this case directly from QGIS UI. Load into QGIS input data: Jena city region (osm/jena_boundary.gpkg) and Sentinel bands (red and near-infrared channels) from sentinel/sample directory.

../_images/qgis-input-data.png

Fig. 44 Input data loaded in QGIS.

Processing plugin

Processing plugin is a generic toolbox which allows to run tools provided by QGIS or third-party software packages like eg. GRASS. Let’s open Processing ‣ Toolbox and search for i.vi GRASS module.

../_images/processing-i-vi.png

Fig. 45 Search for i.vi GRASS module in Processing toolbox.

../_images/processing-i-vi-params.png

Fig. 46 Set input parameters (red and nir channels). Computation extent can be optionally defined in Advanced parameters section.

Fig. 47 shows how Processing plugin works. First of all a temporary GRASS location is created by g.proj, input data is linked into temporary location by r.external. Then computation can finally starts by running i.vi module. In the last step output data is exported out of GRASS using r.out.gdal. The resultant GeoTiff file is vizualized in QGIS map window.

../_images/processing-i-vi-running.png

Fig. 47 Running i.vi tool and exporting result from GRASS temporary location.

../_images/processing-result.png

Fig. 48 Computed NDVI raster vizualized in QGIS map window (with better color interpretation than grayscale). No clouds mask involved.