Update r.vif add-on for GRASS GIS

I just updated the r.vif add-on. The add-on let’s you do a step-wise variance inflation factor (VIF) procedure. As explained in more detail here, the VIF  can be used to detect multicollinearity in a set of explanatory variables. The step-wise selection procedure provides a way to select a et of variables with sufficient low multicollinearity.

The update should make the computation of VIF much faster. For very large raster layers it is possible to have the VIF computed based on a random subset of raster cells. There is also a low-memory option. This allows one to run this add-on with much larger data sets. But, as explained in the r.vif manual page, it also runs considerably slower.

A GRASS GIS addon to upload raster values and labels to a point layer

In GRASS GIS you can upload raster values at positions of vector points to the attribute table of that vector point layer using the function v.what.rast. If you also interested in the raster category labels, you can have a look at r.what, which lets you query a raster map  on their category values and category labels.

However, the results of r.what are written to a text file. If you want to upload raster values and labels to the attribute table of a point vector map, you can use  v.in.ascii to import the text file created with r.what as a point vector layer in GRASS GIS.

Fairly straightforward, but wouldn’t it be even more convenient if you you had an option in r.what.rast to also upload the category labels? Continue reading “A GRASS GIS addon to upload raster values and labels to a point layer”

Update of the r.forestfrag addon for GRASS GIS

Some time ago I came across this post from Sylla Consult about a script to calculate forest fragmentation index suggested by Riitters et al. (2000). Obviously, it can be used for any land cover type, so perhaps landscape fragmentation index would be a better name. Anyway, the script r.forestfrag.sh is available from the GRASS-addons page.

Unfortunately, it only worked with GRASS 6.4. Because I mostly work in GRASS 7.0 I adapted the script to make it work on GRASS 7.0.  I also added some additional options and changes: Continue reading “Update of the r.forestfrag addon for GRASS GIS”