Start and GRASS data structureFor this introduction we create new mapset intro to keep data organized.
Add raster mapLet's add raster map called elev_lid792_1m to the Layer Manager so that it is displayed in the Map Display. You can either use the add raster icon in the toolbar or you can use main menu File → Map display → Add raster. Then select raster map from the selection.
GRASS modulesGRASS functionality is available through modules (tools). Modules respect following naming conventions:
|general||g.*||g.list, g.remove, g.copy|
|raster||r.*||r.univar, r.neighbors, r.contour|
|vector||v.*||v.info, v.generalize, v.db.select|
|imagery||i.*||i.segment, i.cluster, i.colors.enhance|
|3D raster||r3.*||r3.info, r3.to.rast, r3.colors|
|temporal||t.*||t.list, t.rast.aggregate, t.vect.univar|
Finding and running a moduleTp find a module for your analysis, type the term into the search box in the Search modules tab, keep pressing Enter until you find your module. Alternatively, you can just browse through the module tree and that's what you can do in the main menu as well. For example, to find information about a raster map, use: Raster → Reports and statistics → Basic raster metadata.
Running a module as a commandIf you already know the name of the module, you can just use it in the command line. The GUI offers a Command console tab with command line specifically build for running GRASS GIS modules. If you type module name there, you will get suggestions for automatic completion of the name. After pressing Enter, you will get GUI dialog for the module. You can use the command line to run also whole commands for example when you get a command, i.e. module and list of parameters, in the instructions.
Module parametersThe same analysis can be done using the following command:
Conversely, you can fill the GUI dialog parameter by parameter when you have the command.r.neighbors -c input=elevation output=elev_smooth size=5
Region settingsBefore we use a module to compute a new raster map, we must set properly computational region. All raster computations will be performed in the specified extent and with the given resolution. The numeric values of computational region can be checked using:
After executing the command you will get something like this:g.region -p
north: 220750 south: 220000 west: 638300 east: 639000 nsres: 1 ewres: 1 rows: 750 cols: 700 cells: 525000
Set the computational extent and resolution of the mapset to match map
We can set it to match a raster map like this:
Running modulesFind the module for computing slope and aspect in menu or the module tree under Raster → Terrain analysis → Slope and aspect or simply run r.slope.aspect.
- Getting started with GRASS GIS GUI video
- GRASS GIS GUI (graphical user interface manual)
- Understanding module GUI dialogs
- Similar introduction as a web page and as PDF slides
- Browse GRASS GIS modules: by topic, by keyword and by individual modules