Exporting your GRASS raster using r.out.gdal? Check the createopt options!

GRASS GIS can export your raster layer in most common (and quite a few less common) data formats using the r.out.gdal function (menu: file – export raster map – common raster formats). Exporting is so simple that you may forget that depending on the output format there are different options to optimise your output raster layer. Continue reading “Exporting your GRASS raster using r.out.gdal? Check the createopt options!”

Sampling raster values at point locations in QGIS – an update

In a by now fairly old post I described how to sample raster values at point location in QGIS. The method I described used the ‘Point Sampling Tool’ addon. However, the function creates a new point layer, which only contains the values extracted from the raster layer. None of the fields in the original point layer is copied to the new one. It is possible to join the attribute table of the new vector point layer with the original attribute table afterwards using a spatial join as explained in that post. However, this will not work if your point data includes points with exactly the same coordinates.

Since I wrote that post, QGIS has come a long way. Continue reading “Sampling raster values at point locations in QGIS – an update”

One of those handy GRASS GIS functions I didn’t know about

Recently I needed to create a series of temporally interpolated rasters in between two input raster maps, viz., a suitability distribution map under climate conditions in 2000 and under projected climate conditions in 2020. I though this would be a good time to try out the new temporal database in GRASS GIS and use the t.rast.gapfill function, which replaces gaps in a space time raster data-set with interpolated raster maps using linear interpolation. Continue reading “One of those handy GRASS GIS functions I didn’t know about”

Calculating the raster cell area of an unprojected raster layer

What if you get a raster layer with number of people per raster cell, like for example the population layer from Afripop,  and you want to convert it to a population density layer?

Well, obviously, you need to divide the number of people by the surface area of the raster cells. However, the surface area of the raster cells of an unprojected (lat/lon) are not constant; they decrease with increasing latitude. So what you need is a raster layer with the surface areas of the cells.

I thought I had seen a function in GRASS GIS to do this, but that might have been a typical case of the wish being the father to the thought. But anyway, it isn’t terribly difficult to calculate it yourself using the map calculator. Continue reading “Calculating the raster cell area of an unprojected raster layer”

Importing global rasters in GRASS gives me ‘illegal latitude for North’ message

Importing data layers with a global coverage in GRASS GIS might in some cases result in the error message G_set_window(): Illegal latitude for North”. For example, I got the message while trying to import the GlobCover 2009 (version 2.3). Continue reading “Importing global rasters in GRASS gives me ‘illegal latitude for North’ message”