Start and GRASS data structure

For this introduction we create new mapset intro to keep data organized.
Select a GRASS GIS Spatial Database, Location and Mapset at the beginning
GRASS GIS Spatial Database structure


Add raster map

Let'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.
Display a raster map

Display legend

Show and hide legend

GRASS modules

GRASS functionality is available through modules (tools). Modules respect following naming conventions:

group prefix examples
general g.* g.list, g.remove, g.copy
raster r.* r.univar, r.neighbors, r.contour
vector v.*, v.generalize,
imagery i.* i.segment, i.cluster, i.colors.enhance
3D raster r3.*,, r3.colors
temporal t.* t.list, t.rast.aggregate, t.vect.univar
... ... ...
These are the main groups of modules. There is few more for specific purposes. Note also that some modules have multiple dots in their names. This often suggests further grouping. For example, modules staring with deal with vector network analysis.

Finding and running a module

Tp 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.
Search for a module in module tree
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.
Select a module from main menu

Running a module as a command

If 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.
Automatic suggestions when typing name of 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 parameters

Module GUI dialog
The same analysis can be done using the following command:
r.neighbors -c input=elevation output=elev_smooth size=5
Conversely, you can fill the GUI dialog parameter by parameter when you have the command.

Region settings

Before 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:
g.region -p
After executing the command you will get something like this:
north:      220750
south:      220000
west:       638300
east:       639000
nsres:      1
ewres:      1
rows:       750
cols:       700
cells:      525000
Computational region extent (red) set to match the smaller raster map

Set the computational extent and resolution of the mapset to match map elev_lid792_1m. We can set it to match a raster map like this:

Set computational region extent and resolution using a raster map

Running modules

Find 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.
Select input elevation raster map
Enter names of output raster maps. Note also the corresponding command at the bottom of the GUI dialog.
Use manual included in the GUI dialog to refer to details
Press Run (1) to compute. When computed result is added to Layer Manager and Map Display. Use Close (2) to close the window.

Learn more