This plugin generates contours for data values at points in a point vector layer. The contour are created in a new layer that can be either a line layer, for contour lines, or a polygon layer, for filled contours. The plugin uses contouring algorithms from the matplotlib library and can contour either gridded or randomly located data. For non-gridded data the contouring is based on a Delauney triangulation of the data points. .
The plugin requires the python libraries numpy and matplotlib python libaries to be installed.
The contouring function can be used either from a dialog box in which settings are entered interactively, or from a processing module. The processing module can be built into user's processing scripts, or called from python scripts.
The contour dialog is accessed from the contour button installed into the QGIS vector menu or on the contour menu bar.
The dialog is organised into three sections
The contour layer is generated using the
If a generated contour layer is the active layer when the dialog is opened then the original settings will be reloaded so that the settings can be edited if necessary and the layer regenerated. button. Once all the required contour layers have been built the button is used to close the dialog box.The data to be contoured are selected by picking a vector layer of point features and a numeric data value at each point. The data value can be either the value of an attribute of the layer value, or an expression calculated from field values.
The data set can be restricted to just a selected subset of the layer if required. The points to be used must be selected before opening the contour dialog.
The contouring plugin can use two different methods for contouring. Gridded data can be contoured more efficiently than irregular data, so once the data has been selected the plugin checks to see if it is organised as a grid, and if so uses grid based contouring by default. However this can be overridden by the user if required. Otherwise the contouring is derive by first building a Delauney triangulation across the data points, and then contouring across each triangle.
If the data set contains colocated points or points very close together then the triangulation algorithm may fail to run. In this case there is an option to remove duplicate points. Note that this uses a very simplistic algorithm, simply discarding points that are near to other points, so some information may be lost if this option is selected. Duplicate points are identified by specifying a tolerance such that if a group of points are closer together than this distance then all but one will be discarded. Setting the value to zero means that no points are discarded. The tolerance is in metres.
The input box is used to select the data to be contoured. This requires choosing the map layer containing the data (only point layers are available), and the data field of the layer containing the values to be contoured.
Contours can be represented either as line features along the contour levels, or as filled polygon features defining the area between each contour level and the next, or as layer polygons defining the area above the contour level. As a convenience contour lines and filled polygons can be generated at the same time.
The method defines how the contour levels are calculated. Each method may use a number of the parameters interval, number, minimum, and maximum.
The methods available are:
The parameters that can be set depend on the contouring method. The parameters that can be selected are:
If the user selected contour levels method is used then the contour values are entered by clicking on the contour levels to the right of the parameters. This will open a dialog box in which either a single level can be entered, to replace the value clicked, or a set of levels separated by spaces, in which case the values replace the complete set of contour levels.
The extend option is used for filled contours. These are generated as polygons within which the values lies between two contour levels. Optionally the plugin can also generate polygons for the area where the data is less than the minimum contour level or greater than the maximum contour level. The extend option is used to choose which of these are created.
The default output layer name is generated based on the input layer and the name of the field or expression defining the data values. However this can be changed to whatever is required in the dialog box.
The layer has attributes based on the contour level (or levels for filled contour), including a "label" attribute that can be used for labelling the features. The options for formatting the label are:
The plugin can render the layer using a categorized renderer using a different colour for each contour level. This is particularly useful for displaying filled contours. This is set using the Apply colours option. The colours are selected from a colour ramp which may be reversed if required.