Skip to content

Commit

Permalink
Factorize the Min and Max value settings group (#3447)
Browse files Browse the repository at this point in the history
* Add min-max raster values screenshot for symbology
* Factorize the Min and Max value settings group
Currently setting the min and max values description is repeated in the doc. This commit fixes this with a dedicated section and links from each render type that makes use of such setting.
  • Loading branch information
DelazJ committed Feb 22, 2019
1 parent 662a32b commit 2db9433
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 88 deletions.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
169 changes: 81 additions & 88 deletions source/docs/user_manual/working_with_raster/raster_properties.rst
Expand Up @@ -121,9 +121,21 @@ Multiband color

With the multiband color renderer, three selected bands from the image will be
rendered, each band representing the red, green or blue component that will be
used to create a color image. You can choose several :guilabel:`Contrast
enhancement` methods: 'No enhancement', 'Stretch to MinMax', 'Stretch and clip
to MinMax' and 'Clip to min max'.
used to create a color image. QGIS automatically fetches
:guilabel:`Min` and :guilabel:`Max` values for each band of the raster and scales
the coloring accordingly. You can control the value ranges with the help
of the :ref:`Min/Max Value Settings <minmaxvalues>` section.

A :guilabel:`Contrast enhancement` method can also be applied to the values:
'No enhancement', 'Stretch to MinMax', 'Stretch and clip to MinMax' and 'Clip to min max'.

.. index:: Contrast enhancement

.. note:: **Contrast enhancement**

When adding GRASS rasters, the option *Contrast enhancement* will always be
set automatically to *stretch to min max*, regardless of if this is set to
another value in the QGIS general options.

.. _figure_raster_multiband:

Expand All @@ -132,38 +144,15 @@ to MinMax' and 'Clip to min max'.

Raster Symbology - Multiband color rendering

This selection offers you a wide range of options to modify the appearance
of your raster layer. First of all, you have to get the data range from your
image. This can be done by choosing the :guilabel:`Extent` and pressing
:guilabel:`Load`. QGIS can |radioButtonOn| :guilabel:`Estimate (faster)` the
:guilabel:`Min` and :guilabel:`Max` values of the bands or use the
|radioButtonOff| :guilabel:`Actual (slower)` :guilabel:`Accuracy`.

Now you can scale the colors with the help of the :guilabel:`Load min/max values`
section. A lot of images have a few very low and high data. These outliers can be
eliminated using the |radioButtonOn| :guilabel:`Cumulative count cut` setting.
The standard data range is set from 2% to 98% of the data values and can be adapted
manually. With this setting, the gray character of the image can disappear.
With the scaling option |radioButtonOff| :guilabel:`Min/max`, QGIS creates a color
table with all of the data included in the original image (e.g., QGIS creates
a color table with 256 values, given the fact that you have 8 bit bands).
You can also calculate your color table using the |radioButtonOff| :guilabel:`Mean
+/- standard deviation x` |selectNumber|.
Then, only the values within the standard deviation or within multiple standard deviations
are considered for the color table. This is useful when you have one or two cells
with abnormally high values in a raster grid that are having a negative impact on
the rendering of the raster.

All calculations can also be made for the |radioButtonOff| :guilabel:`Current` extent.


.. tip:: **Viewing a Single Band of a Multiband Raster**

If you want to view a single band of a multiband
image (for example, Red), you might think you would set the Green and Blue
bands to "Not Set". But this is not the correct way. To display the Red band,
set the image type to 'Singleband gray', then select Red as the band to use
for Gray.
bands to :guilabel:`Not Set`. But this is not the correct way. To display the Red band,
set the image type to :ref:`Singleband gray <singleband_gray>`, then select Red
as the :guilabel:`Gray band` to use.


.. _paletted:

Expand All @@ -187,26 +176,19 @@ a color to each unique raster value.

Raster Symbology - Paletted unique value rendering

.. index:: Contrast enhancement

**Contrast enhancement**

.. note::
When adding GRASS rasters, the option *Contrast enhancement* will always be
set automatically to *stretch to min max*, regardless of if this is set to
another value in the QGIS general options.

.. _singleband_gray:

Singleband gray
...............

This renderer allows you to render a single band layer with a :guilabel:`Color gradient`:
'Black to white' or 'White to black'. You can define a :guilabel:`Min`
and a :guilabel:`Max` value by choosing the :guilabel:`Extent` first and
then pressing :guilabel:`Load`. QGIS can |radioButtonOn| :guilabel:`Estimate (faster)`
the :guilabel:`Min` and :guilabel:`Max` values of the bands or use the
|radioButtonOff| :guilabel:`Actual (slower)` :guilabel:`Accuracy`.
This renderer allows you to render a single band layer with a :guilabel:`Color
gradient`: 'Black to white' or 'White to black'. You can define a range of values
to color other than the default :guilabel:`Min` and :guilabel:`Max` values of the
whole raster, thanks to the :ref:`Min/Max Value Settings <minmaxvalues>` option.

Again, a :guilabel:`Contrast enhancement` method can be applied to the values:
'No enhancement', 'Stretch to MinMax', 'Stretch and clip to MinMax' and 'Clip to min max'.

.. _figure_raster_gray:

Expand All @@ -216,19 +198,6 @@ the :guilabel:`Min` and :guilabel:`Max` values of the bands or use the
Raster Symbology - Singleband gray rendering


With the :guilabel:`Load min/max values` section, scaling of the color table
is possible. Outliers can be eliminated using the |radioButtonOn| :guilabel:`Cumulative
count cut` setting.
The standard data range is set from 2% to 98% of the data values and can
be adapted manually. With this setting, the gray character of the image can disappear.
Further settings can be made with |radioButtonOff| :guilabel:`Min/max` and
|radioButtonOff| :guilabel:`Mean +/- standard deviation x` |selectNumber|.
While the first one creates a color table with all of the data included in the
original image, the second creates a color table that only considers values
within the standard deviation or within multiple standard deviations.
This is useful when you have one or two cells with abnormally high values in
a raster grid that are having a negative impact on the rendering of the raster.

.. index:: Color map, Color interpolation, Discrete
.. _label_colormaptab:

Expand All @@ -246,35 +215,12 @@ You can also create individual color maps for the single bands here.
Raster Symbology - Singleband pseudocolor rendering


Three types of color interpolation are available:

#. Discrete
#. Linear
#. Exact
Using a :guilabel:`Band` of the layer and a :ref:`values range <minmaxvalues>`,
three types of color :guilabel:`Interpolation` are available:

You can choose the band on which QGIS will render the layer, then define
a :guilabel:`Min` and :guilabel:`Max` value.

Defining :guilabel:`Min/Max` values can be done with the help of the :guilabel:`Load min/max values` section.
A lot of images have a few very low and high data. These outliers can be eliminated
using the |radioButtonOn| :guilabel:`Cumulative count cut` setting. The standard
data range is set from 2% to 98% of the data values and can be adapted manually.

With this setting, the gray character of the image can disappear.
With the scaling option |radioButtonOn| :guilabel:`Min/max`, QGIS creates a color
table with all of the data included in the original image (e.g., QGIS creates a
color table with 256 values, given the fact that you have 8 bit bands).
You can also calculate your color table using the |radioButtonOn| :guilabel:`Mean +/-
standard deviation x` |selectNumber|.
Then, only the values within the standard deviation or within multiple standard deviations
are considered for the color table.

In the next part, :guilabel:`Interpolation` allows you to choose which
interpolation mode to use between:

* Discrete (a <= symbol appears in the value column);
* Linear;
* Exact (an equal symbol appears in the Value column);
* Discrete (a <= symbol appears in the value column)
* Linear
* Exact (an equal symbol appears in the Value column)

The :guilabel:`Color ramp` drop down list lists the color ramp in your QGIS. You
can add a new one, edit or save the one you changed. The name of the color ramp
Expand Down Expand Up @@ -304,10 +250,12 @@ defined color table for other sessions.
The |checkbox| :guilabel:`Clip out of range values` allows QGIS to not render pixel
greater than the :guilabel:`Max` value.


.. index:: Hillshade
.. _hillshade_renderer:

Hillshade
---------
.........

Render a band of the raster layer using hillshading.

Expand All @@ -322,9 +270,54 @@ Options:

* :guilabel:`Band`: The raster band to use.
* :guilabel:`Altitude`: The elevation angle of the light source (default is ``45°``).
* :guilabel:`Azimuth`: The azimuth of the light source (default is ``315``).
* :guilabel:`Azimuth`: The azimuth of the light source (default is ``315°``).
* :guilabel:`Z Factor`: Scaling factor for the values of the raster band (default is ``1``).
* |checkbox| :guilabel:`Multidirectional`: Specify if multidirectional hillshading is to be used (default is ``off``).
* |checkbox| :guilabel:`Multidirectional`: Specify if multidirectional hillshading
is to be used (default is ``off``).


.. _minmaxvalues:

Setting the min and max values
..............................

By default, QGIS reports the :guilabel:`Min` and :guilabel:`Max` values of the band(s)
of the raster. A few very low and/or high values can have a
negative impact on the rendering of the raster. The :ref:`Min/Max Value Settings
<minmaxvalues>` menu helps you control the values to render.

.. _figure_raster_minmaxvalues:

.. figure:: img/rasterMinMaxValues.png
:align: center

Raster Symbology - Min and Max Value Settings


Available options are:

* |radioButtonOff| :guilabel:`User defined`: The default
:guilabel:`Min` and :guilabel:`Max` values of the band(s) can be overridden
* |radioButtonOff| :guilabel:`Cumulative count cut`: Removes outliers.
The standard range of values is ``2%`` to ``98%``, but can
be adapted manually.
* |radioButtonOn| :guilabel:`Min/max`: Uses the whole range of values in the image band.
* |radioButtonOff| :guilabel:`Mean +/- standard deviation x`: Creates a color
table that only considers values within the standard deviation or within multiple
standard deviations. This is useful when you have one or two cells with abnormally
high values in a raster grid that are having a negative impact on the rendering
of the raster.

Calculations of the min and max values of the bands are made based on the:

* :guilabel:`Statistics extent`: it can be :guilabel:`Whole raster`,
:guilabel:`Current canvas` or :guilabel:`Updated canvas`
* and the :guilabel:`Accuracy`, which can be either :guilabel:`Estimate (faster)`
or :guilabel:`Actual (slower)`.

.. note:: For some settings, you may need to press the :guilabel:`Apply` button of
the layer properties dialog in order to display the actual min and max values
in the widgets.


Color rendering
Expand Down

0 comments on commit 2db9433

Please sign in to comment.