GRASS GIS categorical raster layers in QGIS

With the QGIS GRASS plugin, you can easily open a GRASS raster layer in QGIS. One disadvantage, however, is that if your GRASS layer has category labels, these will not show in the QGIS legend. See for example the landuse layer in the North Carolina data set,  opened in QGIS in the screenshot below.

screenshot1

It isn’t too much problem to define the labels in QGIS if you have few categories only, but what if your map in GRASS has many categories, all neatly labelled in GRASS. Sure you don’t want to add those category labels manually again in QGIS?

I don’t, so I wrote a small GRASS GIS addon, r.category.trim, that export the attribute table and colour table in GRASS GIS as a QGIS colour map file.

Continue reading “GRASS GIS categorical raster layers in QGIS”

Update of r.mess to work in GRASS 7

A while back I wrote a GRASS GIS addon to calculate the Multivariate Environmental Similarity index (MES; see below for a short description). The addon was written as a shell script and R script and only runs on GRASS GIS 6.

I finally got around rewriting the addon in Python. This should make it easier to install (using the g.extension function) and it does not depend on R any more. You can install the addon from the g.extension menu or you can go here. Continue reading “Update of r.mess to work in GRASS 7”

Recode your raster file in GRASS GIS using a csv file

The two easiest ways to reclassify a raster layer in GRASS GIS are using the r.reclass or r.recode functions. Although both are easy enough to use, sometimes it would be nice if you could just provide the input layer and a simple table with re-class values to create new raster maps. A fairly trivial task, so ideal to make another attempt at creating a python script.

I create a small add-on (r.recode.attr) that let you reclass/recode a raster layer based on values in a csv (comma separated text) file. The csv file should include one column with the raster values and one or more columns with the reclassification values. For each of these columns a new map will be created.  See the manual page for more information. Continue reading “Recode your raster file in GRASS GIS using a csv file”