This prevents the Python GIL from being released before calling the method
(which is the default behaviour). For very cheap to call c++ methods the
cost of releasing the GIL can outweigh the cost of the c++ call, which means
it's more efficient to retain the hold on the GIL.
Ideally we'd do this everywhere, and switch to an explicit ReleaseGIL
annotation on functions which are slow or risky (raise exceptions, or
do something which can cause a GIL deadlock). But those are very tricky
to identify, so instead just explicitly hold the gil on cheap methods
which are likely to be called many times and could have an impact on
script performance.
The trust flag at the projetc level is only used to read vector layer extent from xml, not from provider.
This flag was not available at the vector layer and data provider level.
We propose a new QgsMapLayer reading flag to propagate the trust layer metadata prohect's read flag an d a new provider options to trust datasource config.
Trusting the datasource config means that the provider can use estimated metadata, the primary key is unique and the detectable geometry type and srid are the same as the requested.
Also
* in settings UI, add a 'Early resampling' checkbox
* in raster properties UI, add similar checkbox
* serialize/deserialize new settings in QgsRasterLayer XML
Fixes#36820
The way QGIS is currently handling resampling is sub-optimal given GDAL >= 2
capability of having sub-pixel accuracy. So when a QgsRasterResampleFilter
is set, make it try to delegate resampling back to the underlying input interface,
and implement that improved resampling in the GDAL provider.
The GDAL resampling will take into account the settings of the QGIS resample
filter: zoom-in resampling kernel, zoom-out resampling kernel and max resampling
factor. The later is important to avoid performance issues if not enough overview
levels are generated (in the case, we will fallback to the generic method, which
may introduce sub-pixel shifts)
This is useful when client needs to find out image space coordinates of a point
in map layer coordinates or vice versa. For warped VRT rasters this can't be
simply done by using geotransform matrix because the transform may be more complex.
This may be also useful functionality for identify tool to show source raster
image coordinates.
Fixes#34813 by introducing a Prefetch rendering flag
and raster provider capability that can be set by
a provider when prefetching of out-of-viewport tiles
is allowed. For now it is only denied (hardcoded) for
OSM but the implementation allows per-layer setting when
a GUI element to set the flag will been created.
This new renderer draws contour lines that are calculated on the fly
from the source raster band. It is possible to set interval of contour
lines and symbol used for drawing.
In addition there is support for "index contours" - contour lines
with higher interval, typically drawn with a wider line symbol.
If we generate contour lines on input raster block with the same size as our
output raster block, the generated lines would contain too much detail.
This detail can be reduced by the "downscale" factor - this will request
lower resolution of the source raster.