Instead of progress changed signals on the provider/layer level,
instead use QgsFeedback arguments for methods which previously
emitted progress changed signals
from a raster layer
Adds an easy way to style discrete rasters such as landuse classes
using the Paletted renderer. Just select the Paletted renderer,
pick a band, then hit the "Add Unique Values" button. The unique
pixel values will be fetched from the layer and a color assigned
to each using the currently selected color ramp.
Fix#14845
Sponsored by
- Stéphane Henriod
- Satelligence (http://satelligence.com/)
- Bird's Eye View (https://www.birdseyeviewgis.com/)
- + other anonymous backers
- Switch to a real model
- Allow adding new rows and deleting multiple selected rows
- Allow changing colors inline in style dock (no modal color picker)
Previously the renderer required that pixel values followed
sequential numerical order. This refactor allows values to
be skipped, so that only certain color index will be rendered.
Avoids confusing overload behavior when constructing QgsRasterLayers
from c++ code. This extra constructor was causing character literals
to be converted to a boolean loadDefaultStyle flag instead
of being used as the provider key. Removing the extra constructor
avoids this, and removes some duplicate code.
To create a 2x2 raster block with one byte per pixel:
```
block = QgsRasterBlock(Qgis.Byte, 2, 2)
block.setData(b'\xaa\xbb\xcc\xdd')
```
To overwrite existing raster data at position 0,0 by the 2x2 block:
```
provider.setEditable(True)
provider.writeBlock(block, band, 0, 0)
provider.setEditable(False)
```
This commit implements the improvements described at:
https://lists.osgeo.org/pipermail/qgis-developer/2016-September/044393.html
The QgsRasterMinMaxWidget now offers a seetting to specify that the statistics
should be computed each time the canvas extent changes.
Other changes:
- the content of the QgsRasterMinMaxWidget is now persistant.
- there is no longer any Load button. The global Apply / OK button of the raster
properties dialog has this effect.
- the default "limits" for single band raster is now MinMax and not CumulativeCut
- the default "limits" can be configured for single band, multi band single byte and
multi band multi byte
- "Strech using current extent" honours the "limits" instead of forcing min/max.