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
You may be aware that there is also a GRASS GIS version 7. So which version should you go for? Well, it depends. Is long-term support, backward-compatibility with the GRASS 6 line and stability important to you. Or do you use the QGIS GRASS GIS toolbox a lot (which is not yet compatible with GRASS 7)? Go for the new GRASS 6.4 series.
Are you always looking for the latest of the latests, or is speed or the ability to handle very large data sets important to you? Have a look at list of new and improved features in GRASS 7. It is still in beta, so in theory less stable. But I should add that I am using this version for some time now (on Linux) and in my experience it is very stable.
Of course, you can also install both, they should run happily next to each other.
I needed to create a raster map layer with a weighted random sample of all raster cells, using the percentage of crop land as weight. I couldn’t find a function to create such a weighted sample, so I decided to create a script to do this for me. Continue reading
If your mapset contains many raster or vector layers GRASS offers a very handy feature to quickly select the layers you want to add to your current map display. In the layer manager, click Ctrl+Shift+L to open the ‘add selected map layers into layer tree’ window. Continue reading
After a long wait, GRASS 7.0 beta is out! See here a summary of what is new in this release. Take your time, is is a long list :-).
In fact, GRASS 7.0 has been available for some time now for those willing to compile it themselves. So have I, and out of experience I can tell you, this is a great release, with tons of new features and improvements, including great speed improvements in handling vector layers, a whole new module for time series analysis, numerous interface improvements, etc.
Really, you should go over to the download page and give it a try! Good change you won’t look back after that.
Sometimes you want to rescale a raster layer, e.g., to reduce the number of categories, or to create a common scale for different raster layers. Very basic of course, so you can expect to find an appropriate function in any self-respecting GIS software. Just be aware that different terms are being used for the same thing, e.g., scale in gdal, rescale in GRASS and normalize in SAGA GIS. Below a few ways to do this using my favourite GIS programs: GRASS GIS, QGIS, SAGA GIS or gdal. Continue reading
GRASS GIS 6.4.3 released – Birthday release for 30 years of GRASS GIS on http://grass.osgeo.org
Good news, check it out: http://grass.osgeo.org/news/25/15/GRASS-GIS-6-4-3RC4-released/
One of my favourite raster formats to share is the geotiff, mostly because I always thought it is one of the most portable formats. But yesterday I got an email from a colleague that the geotiffs I shared looked strange in ArcMap, with hardly any values to show and an apparent range of values of 1,79769e+308 to 2,22507e-308.
In R you can use system calls or the spgrass6 package to run GRASS GIS functions. To do this, you need to run R from within GRASS GIS. This is as simple as starting GRASS GIS and subsequently starting R from the command line. See the GRASS-wiki for a more detailed background.
The issue at hand
One of the user-cases is when you want to (1) run a GRASS function on e.g., a raster layer and (2) capture the console output in a R data frame. For example, you can run the following in R:
MyVariables <- execGRASS("r.stats", flags="c", input="MyMap", separator=",", intern=TRUE)
However, the output is not in a very convenient format. Continue reading