Vector data layers can be edited within QGIS Desktop. Editing allows you to add, delete, and modify features in vector datasets. The first step is to put the dataset into edit mode. Select the layer in the Layers panel and click on Toggle Editing under Layer. Alternatively, you can right-click on a layer in the Layers panel and choose Toggle Editing from the context menu. Multiple layers can be edited at a time. The layer currently being edited is the one selected in the Layers panel. Once you are in the edit mode, the digitizing toolbar (shown in the following screenshot) can be used to add, delete, and modify features:
From left to right, the tools in the digitizing toolbar are as follows:
Snapping is an important editing consideration. It is a specified distance (tolerance) within which vertices of one feature will automatically align with vertices of another feature. The specific snapping tolerance can be set for the whole project or per layer. The method for setting the snapping tolerance for a project varies according to the operating system, which is as follows:
In addition to setting the snapping tolerance, here the snapping mode can also be set to vertex, segment, or vertex and segment. Snapping can be set for individual layers by navigating to Settings | Snapping options. Individual layer snapping settings will override those of the project. The following screenshot shows examples of multiple snapping option choices:
Note that there are also checkboxes for Enable topological editing and Enable snapping on intersection, which are covered in more detail in Chapter 6, Advanced Data Creation and Editing.
There are many digitizing options that can be set by navigating to Settings | Options | Digitizing. These include settings for Feature Creation, Rubberband, Snapping, Vertex markers, and Curve Offset Tool. There is also an Advanced Digitizing toolbar, which is covered in Chapter 6, Advanced Data Creation and Editing.
When you load spatial data layers into QGIS Desktop, they are styled with a random single symbol rendering. To change this, navigate to Layer | Properties | Style.
There are several rendering choices available from the menu in the top-left corner, which are as follows:
The following screenshot shows the Style properties available for a vector data layer:
In the preceding screenshot, the renderer is the layer symbol. For a given symbol, you can work with the first level, which gives you the ability to change the transparency and color. You can also click on the second level, which gives you control over parameters such as fill, border, fill style, border style, join style, border width, and X/Y offsets. These parameters change depending on the geometry of your layer. You can also use this hierarchy to build symbol layers, which are styles built from several symbols that are combined vertically.
You also have many choices when styling raster data in QGIS Desktop. There is a different choice of renderers for raster datasets, which are as follows:
The following is a screenshot of the Style tab of a raster file's Layer Properties, showing where the aforementioned style choices are located:
Another important consideration with raster styling is the settings that are used for contrast enhancement when rendering the data. Let's start by loading the Jemez_dem.img
image and opening the Style menu under Layer Properties (shown in the following figure). This is an elevation layer and the data is being stretched on a black-to-white color ramp from the Min and Max values listed under Band rendering. By default, these values only include those that are from 2 percent to 98 percent of the estimation of the full range of values in the dataset, and cut out the outlying values. This makes rendering faster, but it is not necessarily the most accurate.
Next, we will change these settings to get a full stretch across all the data values in the raster. To do this, perform the following steps:
As shown in the following figure, by enhancing the contrast, the raster is displayed with much more detail, and is more visually attractive, too:
You can specify the default settings for rendering rasters by navigating to Settings | Options | Rendering. Here, the defaults for the Contrast enhancement, Load min/max values, and Cumulative count cut thresholds, and the standard deviation multiplier, can be set.
The blending modes allow for more sophisticated rendering between GIS layers. Historically, these tools have only been available in graphics programs and they are a fairly new addition to QGIS. Previously, only layer transparency could be controlled. There are now 13 different blending modes that are available: Normal, Lighten, Screen, Dodge, Addition, Darken, Multiply, Burn, Overlay, Soft light, Hard light, Difference, and Subtract. These are much more powerful than simple layer transparency, which can be effective but typically results in the underneath layer being washed out or dulled. With blending modes, you can create effects where the full intensity of the underlying layer is still visible. Blending mode settings can be found at the bottom of the Style menu under Layer Properties in the Layer Rendering section (for vectors) and Color rendering section (for rasters).
As an example of using blending modes, we will show vegetation data (Jemez_vegetation.tif
) in combination with a hillshade image (Jemez_hillshade.img
). Both datasets are loaded and the vegetation data is dragged to the top of the layer list. Vegetation is then styled with a singleband pseudocolor renderer; you can do this by performing the following steps:
The following screenshot shows what the Style properties should look like after following the preceding steps:
At the bottom of the Style menu, under Layer Properties, set the Blending mode to Multiply and the Contrast to 45, and click on Apply. The blending mode allows all the details of both the datasets to be seen. Experiment with different blending modes to see how they change the appearance of the image. The following screenshot shows an example of how blending and contrast settings can work together to make a raster pop off the screen: