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.
Moved all temporary projector members to a private class,
so even recursive block() calls will not affect each other
(there is no new performance penalty as block() call always
recomputes the temporary control point matrix anyway)
The improvement allows immediate cancellation of raster rendering
in progress. Until now, even when map rendering got cancelled
(e.g. by zooming of panning canvas), the GUI got blocked while waiting
for raster layers to finish their rendering (only vector layers have
had support for cancellation). This should allow for much smoother
user experience while browsing maps including rasters.
The cancellation is supported currently by WMS/WMTS and WCS providers.
GDAL provider may also get support thanks to improvements in GDAL 2.
Funded by Land Information New Zealand.
- rename methods with XML to Xml, CRS to Crs, WMS to Wms, ID to Id
- rename methods with SRS to Crs
- rename methods with abbreviations like "dest" to "destination"
- rename methods with abbreviations like "src" to "source"