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)
```
And overriding projection is only done if user has manually
chosen a different CRS from the list.
This means that templates and compositions in server can still
adapt to follow the project CRS, but if desired specific map
items (eg an overview map) can use the CRS override to always
show in a particular CRS.
This allows the CRS for map items to differ from the canvas/project
CRS. It also allows different map items to have different CRS,
eg an overview map can be set to a different CRS to the main map.
An unfortunate side effect of this change and the ongoing work
to separate compositions from canvas is that datum transforms
are no longer supported in composer. This cannot be fixed until
the datum transform store is rewritten to not depend on canvas
(ie, it's also broken for upcoming multi-canvas work)
This commit fixes a few bugs on WFS-T with
servers that support WFS-T > 1.0.0 when user
configure version != 1.0.0 ("auto" is the default).
It also fixes WFS-T multiple operations on GeoServer
when an insert operation is among them and the feature
store does not return generated feature ids for the
inserted features (i.e. shapefiles).
Tested on GeoServer and QGIS Server
(cherry-picked from 502a8da40380)
draw shape/arrow/nodes/paper symbols
This commit removes some more instances where changes in the
canvas affect compositions. Previously the symbols drawn
in shape/arrow/etc items were using the scale from the canvas.
This meant that the appearance of these items in composer
would change depending on canvas zoom if they used symbols
with map unit sizes.
Now they take their map scale from the composition's reference
map. While this has the nice side effect that now map units
can be used in the appearance of these items and they're
guaranteed to match up with the reference map item, the main
intention here is to remove more of the forced links between
compositions (core) and the main canvas (app).
This option will be used for more than just world file generation,
and instead will indicate which map should be considered the master
map for the composition from which any composer properties
calculating map units will derive the scale from.
This adds a new item_variables expression function when expressions
are used inside a composition context.
The function takes a single argument, the id for an item inside
the composition, and returns a map of variable name to value
for that item.
This allows you to do things like insert text in a label fetching
properties of another item in the composition, eg
Insert scale of map into a label:
map_get( item_variables( 'map'),'map_scale')
Insert x coordinate of map center into a label:
x(map_get( item_variables( 'map'),'map_extent_center'))
spell check will be done automatically in words by default (when some conditions are fulfilled)
possibility to avoid in words checking by adding :* at the end in spelling.dat
one can add #spellok at the end of a line of code to skip spell check on this line