Download Qgis 2.16 Mac

.

The GRASS plugin provides access to GRASS GIS databases and functionalities(see GRASS-PROJECT in Literature and Web References). This includesvisualizing GRASS raster and vector layers, digitizing vector layers,editing vector attributes, creating new vector layers and analysing GRASS 2-D and3-D data with more than 400 GRASS modules.

Download QGIS 2.18.14-1 for mac Older LTR version: Download QGIS 2.14 for mac QGIS is a Free and Open Source Geographic Information System. With this software you can create, edit, visualise, analyse and publish geospatial information on Windows, Mac, Linux, BSD (Android coming soon). Qgis -help QGIS - 2.6.0-Brighton 'Brighton' (exported) QGIS is a user friendly Open Source Geographic Information System. Usage: /usr/bin/qgis.bin OPTION FILE OPTION: -snapshot filename emit snapshot of loaded datasets to given file -width width width of snapshot to emit -height height height of snapshot to emit -lang language use language for interface text -project. QGIS Documentation Project 2.18 Documentation QGIS 2.18; next; previous » Table Of Contents. User guide/Manual (QGIS 2.18). QGIS-OSGeo4W-2.16.3-1-Setup-x8664.exe: 2016-09-25: 365M: QGIS-OSGeo4W-2.18.10-1-Setup-x8664.exe: 2017-06-23: 381M. Download QGIS 3.4 LTR for windows and mac. Mac OS X installers for QGIS. For OS X Mt Lion and newer. Install the Current version to stay up to date on features. Install the Long Term Support version for feature stability for a year. The current version is QGIS 2.18.15 'Las Palmas' and was released on.

In this section, we’ll introduce the plugin functionalities and give some examplesof managing and working with GRASS data. The following main features are providedwith the toolbar menu when you start the GRASS plugin, as described in sectionsec_starting_grass:

  • Open mapset
  • New mapset
  • Close mapset
  • Add GRASS vector layer
  • Add GRASS raster layer
  • Create new GRASS vector
  • Edit GRASS vector layer
  • Open GRASS tools
  • Display current GRASS region
  • Edit current GRASS region

Starting the GRASS plugin¶

To use GRASS functionalities and/or visualize GRASS vector and raster layers inQGIS, you must select and load the GRASS plugin with the Plugin Manager.Therefore, go to the menu Plugins ‣Manage Plugins, select GRASS and click[OK].

You can now start loading raster and vector layers from an existing GRASSLOCATION (see section sec_load_grassdata). Or, you can create a newGRASS LOCATION with QGIS (see section Creating a new GRASS LOCATION) and importsome raster and vector data (see section Importing data into a GRASS LOCATION) for furtheranalysis with the GRASS Toolbox (see section The GRASS Toolbox).

Loading GRASS raster and vector layers¶

With the GRASS plugin, you can load vector or raster layers using the appropriatebutton on the toolbar menu. As an example, we will use the QGIS Alaska dataset (seesection Sample Data). It includes a small sample GRASS LOCATIONwith three vector layers and one raster elevation map.

  1. Create a new folder called grassdata, download the QGIS ‘Alaska’ datasetqgis_sample_data.zip from http://download.osgeo.org/qgis/data/and unzip the file into grassdata.
  2. Start QGIS.
  3. If not already done in a previous QGIS session, load the GRASS pluginclicking on Plugins ‣Manage Plugins and activate GRASS.The GRASS toolbar appears in the QGIS main window.
  4. In the GRASS toolbar, click the Open mapset iconto bring up the MAPSET wizard.
  5. For Gisdbase, browse and select or enter the path to the newly createdfolder grassdata.
  6. You should now be able to select the LOCATIONalaska and the MAPSETdemo.
  7. Click [OK]. Notice that some previously disabled tools in theGRASS toolbar are now enabled.
  8. Click on Add GRASS raster layer, choose the map namegtopo30 and click [OK]. The elevation layer will be visualized.
  9. Click on Add GRASS vector layer, choose the map namealaska and click [OK]. The Alaska boundary vector layer will beoverlayed on top of the gtopo30 map. You can now adapt the layerproperties as described in chapter The Vector Properties Dialog (e.g.,change opacity, fill and outline color).
  10. Also load the other two vector layers, rivers and airports, andadapt their properties.

As you see, it is very simple to load GRASS raster and vector layers in QGIS.See the following sections for editing GRASS data and creating a new LOCATION.More sample GRASS LOCATIONs are available at the GRASS website athttp://grass.osgeo.org/download/sample-data/.

Tip

GRASS Data Loading

If you have problems loading data or QGIS terminates abnormally, check to makesure you have loaded the GRASS plugin properly as described in sectionStarting the GRASS plugin.

GRASS LOCATION and MAPSET¶

GRASS data are stored in a directory referred to as GISDBASE. This directory, oftencalled grassdata, must be created before you start working with the GRASSplugin in QGIS. Within this directory, the GRASS GIS data are organized by projectsstored in subdirectories called LOCATIONs. Each LOCATION is definedby its coordinate system, map projection and geographical boundaries. EachLOCATION can have several MAPSETs (subdirectories of theLOCATION) that are used to subdivide the project into different topics orsubregions, or as workspaces for individual team members (see Neteler & Mitasova2008 in Literature and Web References). In order to analyze vector and raster layerswith GRASS modules, you must import them into a GRASS LOCATION. (This isnot strictly true – with the GRASS modules r.external and v.externalyou can create read-only links to external GDAL/OGR-supported datasets withoutimporting them. But because this is not the usual way for beginners to work withGRASS, this functionality will not be described here.)

Figure GRASS location 1:

Creating a new GRASS LOCATION¶

As an example, here is how the sample GRASS LOCATIONalaska, which isprojected in Albers Equal Area projection with unit feet was created for theQGIS sample dataset. This sample GRASS LOCATIONalaska will be used forall examples and exercises in the following GRASS-related sections. It isuseful to download and install the dataset on your computer (see Sample Data).

  1. Start QGIS and make sure the GRASS plugin is loaded.
  2. Visualize the alaska.shp shapefile (see sectionLoading a Shapefile) from the QGIS Alaska dataset (see Sample Data).
  3. In the GRASS toolbar, click on the New mapset iconto bring up the MAPSET wizard.
  4. Select an existing GRASS database (GISDBASE) folder grassdata, or createone for the new LOCATION using a file manager on your computer. Thenclick [Next].
  5. We can use this wizard to create a new MAPSET within an existingLOCATION (see section Adding a new MAPSET) or to create a newLOCATION altogether. Select Create newlocation (see figure_grass_location_2).
  6. Enter a name for the LOCATION – we used ‘alaska’ – and click [Next].
  7. Define the projection by clicking on the radio button Projection to enable the projection list.
  8. We are using Albers Equal Area Alaska (feet) projection. Since we happen toknow that it is represented by the EPSG ID 2964, we enter it in the search box.(Note: If you want to repeat this process for another LOCATION andprojection and haven’t memorized the EPSG ID, click on the CRS Status icon in the lower right-hand corner of the status bar (seesection Working with Projections)).
  9. In Filter, insert 2964 to select the projection.
  10. Click [Next].
  11. To define the default region, we have to enter the LOCATION bounds in thenorth, south, east, and west directions. Here, we simply click on the button[Set current qg extent], to apply the extent of the loaded layeralaska.shp as the GRASS default region extent.
  12. Click [Next].
  13. We also need to define a MAPSET within our new LOCATION (thisis necessary when creating a new LOCATION). Youcan name it whatever you like - we used ‘demo’. GRASS automatically creates a special MAPSET calledPERMANENT, designed to store the core data for the project, its defaultspatial extent and coordinate system definitions (see Neteler & Mitasova 2008in Literature and Web References).
  14. Check out the summary to make sure it’s correct and click [Finish].
  15. The new LOCATION, ‘alaska’, and two MAPSETs, ‘demo’ and ‘PERMANENT’,are created. The currently opened working set is ‘demo’, as you defined.
  16. Notice that some of the tools in the GRASS toolbar that were disabled are nowenabled.

Figure GRASS location 2:

Creating a new GRASS LOCATION or a new MAPSET in QGIS

If that seemed like a lot of steps, it’s really not all that bad and a very quickway to create a LOCATION. The LOCATION ‘alaska’ is now ready fordata import (see section Importing data into a GRASS LOCATION). You can also use the already-existingvector and raster data in the sample GRASS LOCATION ‘alaska’,included in the QGIS ‘Alaska’ dataset Sample Data, and move on tosection The GRASS vector data model.

Adding a new MAPSET¶

A user has write access only to a GRASS MAPSET he or she created. This means thatbesides access to your own MAPSET, you can read maps in other users’MAPSETs (and they can read yours), but you can modify or remove only the maps in your own MAPSET.

All MAPSETs include a WIND file that stores the current boundarycoordinate values and the currently selected raster resolution (see Neteler & Mitasova2008 in Literature and Web References, and section The GRASS region tool).

  1. Start QGIS and make sure the GRASS plugin is loaded.
  2. In the GRASS toolbar, click on the New mapset iconto bring up the MAPSET wizard.
  3. Select the GRASS database (GISDBASE) folder grassdata with theLOCATION ‘alaska’, where we want to add a further MAPSETcalled ‘test’.
  4. Click [Next].
  5. We can use this wizard to create a new MAPSET within an existingLOCATION or to create a new LOCATION altogether. Click on theradio button Select location(see figure_grass_location_2) and click [Next].
  6. Enter the name text for the new MAPSET. Below in the wizard, yousee a list of existing MAPSETs and corresponding owners.
  7. Click [Next], check out the summary to make sure it’s all correct andclick [Finish].

Importing data into a GRASS LOCATION¶

This section gives an example of how to import raster and vector data into the‘alaska’ GRASS LOCATION provided by the QGIS ‘Alaska’ dataset.Therefore, we use the landcover raster map landcover.img and the vector GMLfile lakes.gml from the QGIS ‘Alaska’ dataset (see Sample Data).

Download Qgis 2.16 Mac Tutorial

  1. Start QGIS and make sure the GRASS plugin is loaded.
  2. In the GRASS toolbar, click the Open MAPSET iconto bring up the MAPSET wizard.
  3. Select as GRASS database the folder grassdata in the QGISAlaska dataset, as LOCATION ‘alaska’, as MAPSET ‘demo’ andclick [OK].
  4. Now click the Open GRASS tools icon. TheGRASS Toolbox (see section The GRASS Toolbox) dialog appears.
  5. To import the raster map landcover.img, click the moduler.in.gdal in the Modules Tree tab. This GRASS moduleallows you to import GDAL-supported raster files into a GRASSLOCATION. The module dialog for r.in.gdal appears.
  6. Browse to the folder raster in the QGIS ‘Alaska’ datasetand select the file landcover.img.
  7. As raster output name, define landcover_grass and click[Run]. In the Output tab, you see the currently running GRASScommand r.in.gdal-oinput=/path/to/landcover.imgoutput=landcover_grass.
  8. When it says Succesfully finished, click [View output].The landcover_grass raster layer is now imported into GRASS andwill be visualized in the QGIS canvas.
  9. To import the vector GML file lakes.gml, click the modulev.in.ogr in the Modules Tree tab. This GRASS module allowsyou to import OGR-supported vector files into a GRASS LOCATION. Themodule dialog for v.in.ogr appears.
  10. Browse to the folder gml in the QGIS ‘Alaska’ dataset and select thefile lakes.gml as OGR file.
  11. As vector output name, define lakes_grass and click [Run]. Youdon’t have to care about the other options in this example. In theOutput tab you see the currently running GRASS commandv.in.ogr-odsn=/path/to/lakes.gmloutput=lakes_grass.
  12. When it says Succesfully finished, click [View output]. Thelakes_grass vector layer is now imported into GRASS and will bevisualized in the QGIS canvas.

The GRASS vector data model¶

It is important to understand the GRASS vector data model prior to digitizing.

Download Qgis 2.16 Mac Download

In general, GRASS uses a topological vector model.

This means that areas are not represented as closed polygons, but by one or moreboundaries. A boundary between two adjacent areas is digitized only once, and itis shared by both areas. Boundaries must be connected and closed without gaps.An area is identified (and labeled) by the centroid of the area.

Besides boundaries and centroids, a vector map can also contain points and lines.All these geometry elements can be mixed in one vector and will be representedin different so-called ‘layers’ inside one GRASS vector map. So in GRASS, a layeris not a vector or raster map but a level inside a vector layer. This is importantto distinguish carefully. (Although it is possible to mix geometry elements, itis unusual and, even in GRASS, only used in special cases such as vector networkanalysis. Normally, you should prefer to store different geometry elements indifferent layers.)

It is possible to store several ‘layers’ in one vector dataset. For example,fields, forests and lakes can be stored in one vector. An adjacent forest and lakecan share the same boundary, but they have separate attribute tables. It is alsopossible to attach attributes to boundaries. An example might be the case where the boundary between alake and a forest is a road, so it can have a different attribute table.

The ‘layer’ of the feature is defined by the ‘layer’ inside GRASS. ‘Layer’ is thenumber which defines if there is more than one layer inside the dataset (e.g.,if the geometry is forest or lake). For now, it can be only a number. In the future,GRASS will also support names as fields in the user interface.

Attributes can be stored inside the GRASS LOCATION as dBase or SQLite3 orin external database tables, for example, PostgreSQL, MySQL, Oracle, etc.

Attributes in database tables are linked to geometry elements using a ‘category’value.

‘Category’ (key, ID) is an integer attached to geometry primitives, and it isused as the link to one key column in the database table.

Tip

Learning the GRASS Vector Model

The best way to learn the GRASS vector model and its capabilities is todownload one of the many GRASS tutorials where the vector model is describedmore deeply. See http://grass.osgeo.org/documentation/manuals/ for more information,books and tutorials in several languages.

Creating a new GRASS vector layer¶

To create a new GRASS vector layer with the GRASS plugin, click theCreate new GRASS vector toolbar icon.Enter a name in the text box, and you can start digitizing point, line or polygongeometries following the procedure described in section Digitizing and editing a GRASS vector layer.

In GRASS, it is possible to organize all sorts of geometry types (point, line andarea) in one layer, because GRASS uses a topological vector model, so you don’tneed to select the geometry type when creating a new GRASS vector. This isdifferent from shapefile creation with QGIS, because shapefiles use the SimpleFeature vector model (see section Creating new Vector layers).

Tip

Creating an attribute table for a new GRASS vector layer

If you want to assign attributes to your digitized geometry features, makesure to create an attribute table with columns before you start digitizing(see figure_grass_digitizing_5).

Digitizing and editing a GRASS vector layer¶

The digitizing tools for GRASS vector layers are accessed using theEdit GRASS vector layer icon on the toolbar. Make sure youhave loaded a GRASS vector and it is the selected layer in the legend beforeclicking on the edit tool. Figure figure_grass_digitizing_2 shows the GRASSedit dialog that is displayed when you click on the edit tool. The tools andsettings are discussed in the following sections.

Tip

Digitizing polygons in GRASS

If you want to create a polygon in GRASS, you first digitize the boundary ofthe polygon, setting the mode to ‘No category’. Then you add a centroid(label point) into the closed boundary, setting the mode to ‘Next not used’.The reason for this is that a topological vector model links the attribute information ofa polygon always to the centroid and not to the boundary.

Mac

Toolbar

In figure_grass_digitizing_1, you see the GRASS digitizing toolbar icons providedby the GRASS plugin. Table table_grass_digitizing_1 explains the availablefunctionalities.

Figure GRASS digitizing 1:

IconToolPurpose
New PointDigitize new point
New LineDigitize new line
New BoundaryDigitize new boundary (finish by selecting new tool)
New CentroidDigitize new centroid (label existing area)
Move vertexMove one vertex of existing line or boundary and identify new position
Add vertexAdd a new vertex to existing line
Delete vertexDelete vertex from existing line (confirm selected vertex by another click)
Move elementMove selected boundary, line, point or centroid and click on new position
Split lineSplit an existing line into two parts
Delete elementDelete existing boundary, line, point or centroid (confirm selected element by another click)
Edit attributesEdit attributes of selected element (note that one element can represent more features, see above)
CloseClose session and save current status (rebuilds topology afterwards)

Table GRASS Digitizing 1: GRASS Digitizing Tools

Category Tab

The Category tab allows you to define the way in which the categoryvalues will be assigned to a new geometry element.

Figure GRASS digitizing 2:

GRASS Digitizing Category Tab

  • Mode: The category value that will be applied to new geometry elements.
    • Next not used - Apply next not yet used category value to geometry element.
    • Manual entry - Manually define the category value for the geometry elementin the ‘Category’ entry field.
    • No category - Do not apply a category value to the geometry element. This isused, for instance, for area boundaries, because the category values are connected viathe centroid.
  • Category - The number (ID) that is attached to each digitized geometry element.It is used to connect each geometry element with its attributes.
  • Field (layer) - Each geometry element can be connected with severalattribute tables using different GRASS geometry layers. The default layer numberis 1.

Tip

Creating an additional GRASS ‘layer’ with qg

If you would like to add more layers to your dataset, just add a new numberin the ‘Field (layer)’ entry box and press return. In the Table tab, you cancreate your new table connected to your new layer.

Settings Tab

The Settings tab allows you to set the snapping in screen pixels.The threshold defines at what distance new points or line ends are snapped toexisting nodes. This helps to prevent gaps or dangles between boundaries. Thedefault is set to 10 pixels.

Figure GRASS digitizing 3:

Symbology Tab

The Symbology tab allows you to view and set symbology and colorsettings for various geometry types and their topological status (e.g., closed/ opened boundary).

Figure GRASS digitizing 4:

GRASS Digitizing Symbology Tab

Table Tab

How To Download Qgis

The Table tab provides information about the database table for agiven ‘layer’. Here, you can add new columns to an existing attribute table, orcreate a new database table for a new GRASS vector layer (see sectionCreating a new GRASS vector layer).

Figure GRASS digitizing 5:

Tip

GRASS Edit Permissions

You must be the owner of the GRASS MAPSET you want to edit. It isimpossible to edit data layers in a MAPSET that is not yours, evenif you have write permission.

The GRASS region tool¶

The region definition (setting a spatial working window) in GRASS is importantfor working with raster layers. Vector analysis is by default not limited to anydefined region definitions. But all newly created rasters will have the spatialextension and resolution of the currently defined GRASS region, regardless oftheir original extension and resolution. The current GRASS region is stored inthe $LOCATION/$MAPSET/WIND file, and it defines north, south, east andwest bounds, number of columns and rows, horizontal and vertical spatial resolution.

It is possible to switch on and off the visualization of the GRASS region in the QGIScanvas using the Display current GRASS region button.

With the Edit current GRASS region icon, you can opena dialog to change the current region and the symbology of the GRASS regionrectangle in the QGIS canvas. Type in the new region bounds and resolution, andclick [OK]. The dialog also allows you to select a new region interactively with yourmouse on the QGIS canvas. Therefore, click with the left mouse button in the QGIScanvas, open a rectangle, close it using the left mouse button again and click[OK].

The GRASS module g.region provides a lot more parameters to define anappropriate region extent and resolution for your raster analysis. You can usethese parameters with the GRASS Toolbox, described in section The GRASS Toolbox.

Qgis 3.6 Download

The GRASS Toolbox¶

The Open GRASS Tools box provides GRASS module functionalitiesto work with data inside a selected GRASS LOCATION and MAPSET.To use the GRASS Toolbox you need to open a LOCATION and MAPSETthat you have write permission for (usually granted, if you created the MAPSET).This is necessary, because new raster or vector layers created during analysisneed to be written to the currently selected LOCATION and MAPSET.

Figure GRASS Toolbox 1:

Working with GRASS modules¶

The GRASS shell inside the GRASS Toolbox provides access to almost all (more than300) GRASS modules in a command line interface. To offer a more user-friendlyworking environment, about 200 of the available GRASS modules and functionalitiesare also provided by graphical dialogs within the GRASS plugin Toolbox.

A complete list of GRASS modules available in the graphical Toolbox in QGISversion 2.8 is available in the GRASS wiki at http://grass.osgeo.org/wiki/GRASS-QGIS_relevant_module_list.

It is also possible to customize the GRASS Toolbox content. This procedure isdescribed in section Customizing the GRASS Toolbox.

As shown in figure_grass_toolbox_1, you can look for the appropriate GRASSmodule using the thematically grouped Modules Tree or the searchableModules List tab.

By clicking on a graphical module icon, a new tab will be added to the Toolbox dialog,providing three new sub-tabs: Options, Output andManual.

Options

The Options tab provides a simplified module dialog where you canusually select a raster or vector layer visualized in the QGIS canvas and enterfurther module-specific parameters to run the module.

Figure GRASS module 1:

The provided module parameters are often not complete to keep the dialog clear.If you want to use further module parameters and flags, you need to start theGRASS shell and run the module in the command line.

A new feature since QGIS 1.8 is the support for a Show Advanced Optionsbutton below the simplified module dialog in the Options tab. At themoment, it is only added to the module v.in.ascii as an example of use, but it willprobably be part of more or all modules in the GRASS Toolbox in future versionsof QGIS. This allows you to use the complete GRASS module options without the needto switch to the GRASS shell.

Output

Figure GRASS module 2:

GRASS Toolbox Module Output

The Output tab provides information about the output status of themodule. When you click the [Run] button, the module switches to theOutput tab and you see information about the analysis process. Ifall works well, you will finally see a Successfullyfinished message.

Manual

Figure GRASS module 3:

The Manual tab shows the HTML help page of the GRASS module. You canuse it to check further module parameters and flags or to get a deeper knowledgeabout the purpose of the module. At the end of each module manual page, you seefurther links to the MainHelpindex, the Thematicindex and theFullindex. These links provide the same information as themodule g.manual.

Tip

Display results immediately

If you want to display your calculation results immediately in your map canvas,you can use the ‘View Output’ button at the bottom of the module tab.

GRASS module examples¶

The following examples will demonstrate the power of some of the GRASS modules.

Creating contour lines¶

The first example creates a vector contour map from an elevation raster (DEM).Here, it is assumed that you have the Alaska LOCATION set up as explained in sectionImporting data into a GRASS LOCATION.

  • First, open the location by clicking theOpen mapset button and choosing the Alaska location.
  • Now load the gtopo30 elevation raster by clickingAdd GRASS raster layer and selecting thegtopo30 raster from the demo location.
  • Now open the Toolbox with the Open GRASS tools button.
  • In the list of tool categories, double-click Raster ‣ SurfaceManagement ‣ Generate vector contour lines.
  • Now a single click on the tool r.contour will open the tool dialog asexplained above (see Working with GRASS modules). The gtopo30 raster should appear asthe Name of input raster.
  • Type into the Increment between Contour levelsthe value 100. (This will create contour lines at intervals of 100 meters.)
  • Type into the Name for output vector map the name ctour_100.
  • Click [Run] to start the process. Wait for several moments until the messageSuccessfullyfinished appears in the output window. Then click [View Output]and [Close].

Since this is a large region, it will take a while to display. After it finishesrendering, you can open the layer properties window to change the line color sothat the contours appear clearly over the elevation raster, as in The Vector Properties Dialog.

Next, zoom in to a small, mountainous area in the center of Alaska. Zooming in close,you will notice that the contours have sharp corners. GRASS offers the v.generalizetool to slightly alter vector maps while keeping their overall shape. The tooluses several different algorithms with different purposes. Some of the algorithms(i.e., Douglas Peuker and Vertex Reduction) simplify the line by removing some ofthe vertices. The resulting vector will load faster. This process is usefulwhen you have a highly detailed vector, but you are creating a very small-scalemap, so the detail is unnecessary.

Tip

The simplify tool

Download qgis 2.16 mac shortcut

Note that the QGIS fTools plugin has a Simplify geometries ‣tool that works just like the GRASS v.generalize Douglas-Peuker algorithm.

However, the purpose of this example is different. /gmail-download-for-mac-free.html. The contour lines created byr.contour have sharp angles that should be smoothed. Among the v.generalizealgorithms, there is Chaiken’s, which does just that (also Hermite splines). Beaware that these algorithms can add additional vertices to the vector,causing it to load even more slowly.

  • Open the GRASS Toolbox and double-click the categories Vector ‣Develop map ‣ Generalization, then click on the v.generalize module toopen its options window.
  • Check that the ‘ctour_100’ vector appears as the Name of input vector.
  • From the list of algorithms, choose Chaiken’s. Leave all other options at theirdefault, and scroll down to the last row to enter in the field Namefor output vector map ‘ctour_100_smooth’, and click [Run].
  • The process takes several moments. Once Successfullyfinished appears inthe output windows, click [View output] and then [Close].
  • You may change the color of the vector to display it clearly on the rasterbackground and to contrast with the original contour lines. You will noticethat the new contour lines have smoother corners than the original while stayingfaithful to the original overall shape.

Figure GRASS module 4:

Tip

Other uses for r.contour

The procedure described above can be used in other equivalent situations. Ifyou have a raster map of precipitation data, for example, then the same methodwill be used to create a vector map of isohyetal (constant rainfall) lines.

Creating a Hillshade 3-D effect¶

Several methods are used to display elevation layers and give a 3-D effect to maps.The use of contour lines, as shown above, is one popular method often chosen toproduce topographic maps. Another way to display a 3-D effect is by hillshading.The hillshade effect is created from a DEM (elevation) raster by first calculatingthe slope and aspect of each cell, then simulating the sun’s position in the skyand giving a reflectance value to each cell. Thus, you get sun-facing slopeslighted; the slopes facing away from the sun (in shadow) are darkened.

  • Begin this example by loading the gtopo30 elevation raster. Start the GRASSToolbox, and under the Raster category, double-click to open Spatial analysis‣ Terrain analysis.
  • Then click r.shaded.relief to open the module.
  • Change the azimuth angle 270 to 315.
  • Enter gtopo30_shade for the new hillshade raster, and click [Run].
  • When the process completes, add the hillshade raster to the map. You should seeit displayed in grayscale.
  • To view both the hillshading and the colors of the gtopo30 together, movethe hillshade map below the gtopo30 map in the table of contents, then openthe Properties window of gtopo30, switch to theTransparency tab and set its transparency level to about 25%.

You should now have the gtopo30 elevation with its colormap and transparencysetting displayed above the grayscale hillshade map. In order to see thevisual effects of the hillshading, turn off the gtopo30_shade map, then turnit back on.

Using the GRASS shell

The GRASS plugin in QGIS is designed for users who are new to GRASS and notfamiliar with all the modules and options. As such, some modules in the Toolboxdo not show all the options available, and some modules do not appear at all.The GRASS shell (or console) gives the user access to those additional GRASSmodules that do not appear in the Toolbox tree, and also to some additionaloptions to the modules that are in the Toolbox with the simplest defaultparameters. This example demonstrates the use of an additional option in ther.shaded.relief module that was shown above.

Figure GRASS module 5:

The module r.shaded.relief can take a parameter zmult, which multipliesthe elevation values relative to the X-Y coordinate units so that the hillshadeeffect is even more pronounced.

  • Load the gtopo30 elevation raster as above, then start the GRASS Toolboxand click on the GRASS shell. In the shell window, type the commandr.shaded.reliefmap=gtopo30shade=gtopo30_shade2azimuth=315zmult=3 andpress [Enter].
  • After the process finishes, shift to the Browse tab and double-clickon the new gtopo30_shade2 raster to display it in QGIS.
  • As explained above, move the shaded relief raster below the gtopo30 raster inthe table of contents, then check the transparency of the colored gtopo30 layer.You should see that the 3-D effect stands out more strongly compared with thefirst shaded relief map.

Figure GRASS module 6:

Displaying shaded relief created with the GRASS module r.shaded.relief

Raster statistics in a vector map¶

Download Qgis 3.8

The next example shows how a GRASS module can aggregate raster data and add columnsof statistics for each polygon in a vector map.

  • Again using the Alaska data, refer to Importing data into a GRASS LOCATION to import thetrees shapefile from the shapefiles directory into GRASS.
  • Now an intermediate step is required: centroids must be added to the importedtrees map to make it a complete GRASS area vector (including both boundariesand centroids).
  • From the Toolbox, choose Vector ‣ Manage features, and openthe module v.centroids.
  • Enter as the output vector map ‘forest_areas’ and run the module.
  • Now load the forest_areas vector and display the types of forests - deciduous,evergreen, mixed - in different colors: In the layer Propertieswindow, Symbology tab, choose from Legend type ‘Unique value’ and set the Classification fieldto ‘VEGDESC’. (Refer to the explanation of the symbology tab inStyle Menu of the vector section.)
  • Next, reopen the GRASS Toolbox and open Vector ‣ Vector updateby other maps.
  • Click on the v.rast.stats module. Enter gtopo30 and forest_areas.
  • Only one additional parameter is needed: Enter column prefixelev,and click [Run]. This is a computationally heavy operation, which will runfor a long time (probably up to two hours).
  • Finally, open the forest_areas attribute table, and verify that several newcolumns have been added, including elev_min, elev_max, elev_mean,etc., for each forest polygon.

Working with the GRASS LOCATION browser¶

Another useful feature inside the GRASS Toolbox is the GRASS LOCATIONbrowser. In figure_grass_module_7, you can see the current working LOCATIONwith its MAPSETs.

In the left browser windows, you can browse through all MAPSETs inside thecurrent LOCATION. The right browser window shows some meta-informationfor selected raster or vector layers (e.g., resolution, bounding box, data source,connected attribute table for vector data, and a command history).

Figure GRASS module 7:

The toolbar inside the Browser tab offers the following tools to managethe selected LOCATION:

  • Add selected map to canvas
  • Copy selected map
  • Rename selected map
  • Delete selected map
  • Set current region to selected map
  • Refresh browser window

The Rename selected map and Delete selected map only work with maps inside your currently selectedMAPSET. All other tools also work with raster and vector layers inanother MAPSET.

Download Qgis 2.16 Mac Iso

Customizing the GRASS Toolbox¶

Nearly all GRASS modules can be added to the GRASS Toolbox. An XML interface isprovided to parse the pretty simple XML files that configure the modules’appearance and parameters inside the Toolbox.

A sample XML file for generating the module v.buffer (v.buffer.qgm) lookslike this:

The parser reads this definition and creates a new tab inside the Toolbox whenyou select the module. A more detailed description for adding new modules, changinga module’s group, etc., can be found on the QGIS wiki athttp://hub.qgis.org/projects/quantum-gis/wiki/Adding_New_Tools_to_the_GRASS_Toolbox.