2017-06-01 15:39:31 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/raster/qgsrasterdataprovider.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2015-02-03 02:21:52 +01:00
|
|
|
class QgsImageFetcher : QObject
|
|
|
|
{
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
2018-05-26 14:10:30 +10:00
|
|
|
Handles asynchronous download of images
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-06-01 15:39:31 +02:00
|
|
|
.. versionadded:: 2.8
|
|
|
|
%End
|
|
|
|
|
2015-02-03 02:21:52 +01:00
|
|
|
%TypeHeaderCode
|
2017-06-01 15:39:31 +02:00
|
|
|
#include "qgsrasterdataprovider.h"
|
2015-02-03 02:21:52 +01:00
|
|
|
%End
|
|
|
|
public:
|
2017-05-01 18:13:15 +02:00
|
|
|
QgsImageFetcher( QObject *parent = 0 );
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
|
|
|
Constructor
|
|
|
|
%End
|
2015-02-03 02:21:52 +01:00
|
|
|
|
|
|
|
virtual void start() = 0;
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Starts the image download
|
|
|
|
|
2017-06-01 15:39:31 +02:00
|
|
|
.. note::
|
|
|
|
|
2019-02-25 17:20:36 +10:00
|
|
|
Make sure to connect to "finish" and "error" before starting
|
2017-06-01 15:39:31 +02:00
|
|
|
%End
|
2015-02-03 02:21:52 +01:00
|
|
|
|
|
|
|
signals:
|
2017-06-01 15:39:31 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
void finish( const QImage &legend );
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Emitted when the download completes
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2019-02-25 17:20:36 +10:00
|
|
|
:param legend: The downloaded legend image
|
2017-06-01 15:39:31 +02:00
|
|
|
%End
|
2015-02-03 02:21:52 +01:00
|
|
|
void progress( qint64 received, qint64 total );
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
|
|
|
Emitted to report progress
|
|
|
|
%End
|
2017-05-01 18:13:15 +02:00
|
|
|
void error( const QString &msg );
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
|
|
|
Emitted when an error occurs
|
|
|
|
%End
|
2015-02-03 02:21:52 +01:00
|
|
|
};
|
|
|
|
|
2017-06-01 15:39:31 +02:00
|
|
|
|
2012-09-13 13:38:39 +02:00
|
|
|
class QgsRasterDataProvider : QgsDataProvider, QgsRasterInterface
|
2007-01-09 02:39:15 +00:00
|
|
|
{
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Base class for raster data providers.
|
2010-08-03 22:32:56 +00:00
|
|
|
%End
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2017-06-01 15:39:31 +02:00
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgsrasterdataprovider.h"
|
|
|
|
%End
|
2010-08-03 21:24:22 +00:00
|
|
|
public:
|
2018-02-20 09:59:39 +10:00
|
|
|
|
|
|
|
enum ProviderCapability
|
|
|
|
{
|
|
|
|
NoProviderCapabilities,
|
|
|
|
ReadLayerMetadata,
|
|
|
|
WriteLayerMetadata,
|
2020-06-09 23:55:32 +02:00
|
|
|
ProviderHintBenefitsFromResampling,
|
|
|
|
ProviderHintCanPerformProviderResampling
|
2018-02-20 09:59:39 +10:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef QFlags<QgsRasterDataProvider::ProviderCapability> ProviderCapabilities;
|
|
|
|
|
|
|
|
|
2007-01-09 02:39:15 +00:00
|
|
|
QgsRasterDataProvider();
|
|
|
|
|
2020-08-26 17:48:28 +02:00
|
|
|
QgsRasterDataProvider( const QString &uri,
|
|
|
|
const QgsDataProvider::ProviderOptions &providerOptions = QgsDataProvider::ProviderOptions(),
|
|
|
|
QgsDataProvider::ReadFlags flags = QgsDataProvider::ReadFlags() );
|
2018-05-21 11:10:34 +10:00
|
|
|
%Docstring
|
|
|
|
Constructor for QgsRasterDataProvider.
|
|
|
|
|
|
|
|
The ``uri`` argument gives a provider-specific uri indicating the underlying data
|
|
|
|
source and it's parameters.
|
|
|
|
|
2020-08-26 17:48:28 +02:00
|
|
|
The ``options`` argument specifies generic provider options and since QGIS 3.16 creation flags are specified within the ``flags`` value.
|
2018-05-21 11:10:34 +10:00
|
|
|
%End
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2017-05-03 07:45:22 +02:00
|
|
|
virtual QgsRasterInterface *clone() const = 0;
|
2012-08-16 17:05:29 +02:00
|
|
|
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2018-02-20 09:59:39 +10:00
|
|
|
virtual QgsRasterDataProvider::ProviderCapabilities providerCapabilities() const;
|
|
|
|
%Docstring
|
|
|
|
Returns flags containing the supported capabilities of the data provider.
|
|
|
|
|
|
|
|
.. versionadded:: 3.0
|
|
|
|
%End
|
|
|
|
|
2017-06-01 15:39:31 +02:00
|
|
|
virtual bool setInput( QgsRasterInterface *input );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
It makes no sense to set input on provider */
|
2017-06-01 15:39:31 +02:00
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2016-07-10 21:30:19 +10:00
|
|
|
virtual QgsRectangle extent() const = 0;
|
2012-12-17 18:29:08 +01:00
|
|
|
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2016-07-21 22:01:38 +10:00
|
|
|
virtual Qgis::DataType dataType( int bandNo ) const = 0;
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
|
|
|
Returns data type for the band specified by number
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2020-04-02 19:38:47 +02:00
|
|
|
virtual QgsFields fields() const;
|
|
|
|
%Docstring
|
|
|
|
Returns the fields of the raster layer for data providers that expose them,
|
|
|
|
the default implementation returns an empty list.
|
|
|
|
|
|
|
|
.. versionadded:: 3.14
|
|
|
|
%End
|
2016-07-21 22:01:38 +10:00
|
|
|
virtual Qgis::DataType sourceDataType( int bandNo ) const = 0;
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns source data type for the band specified by number,
|
|
|
|
source data type may be shorter than dataType
|
2017-06-01 15:39:31 +02:00
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-02-21 18:14:58 +01:00
|
|
|
virtual int colorInterpretation( int bandNo ) const;
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
|
|
|
Returns data type for the band specified by number
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
|
|
|
QString colorName( int colorInterpretation ) const;
|
|
|
|
virtual bool reload();
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
|
|
|
Reload data (data could change)
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-02-21 18:14:58 +01:00
|
|
|
virtual QString colorInterpretationName( int bandNo ) const;
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2014-01-10 10:36:12 +01:00
|
|
|
virtual double bandScale( int bandNo ) const;
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Read band scale for raster value
|
|
|
|
|
2017-06-01 15:39:31 +02:00
|
|
|
.. versionadded:: 2.3
|
|
|
|
%End
|
2014-01-10 10:36:12 +01:00
|
|
|
|
2017-06-01 15:39:31 +02:00
|
|
|
virtual double bandOffset( int bandNo ) const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Read band offset for raster value
|
|
|
|
|
2017-06-01 15:39:31 +02:00
|
|
|
.. versionadded:: 2.3
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
|
|
|
|
2019-08-22 11:27:40 +02:00
|
|
|
virtual QgsRasterBlock *block( int bandNo, const QgsRectangle &boundingBox, int width, int height, QgsRasterBlockFeedback *feedback = 0 ) /Factory/;
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
|
|
|
Read block of data using given extent and size.
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2016-07-19 11:45:47 +10:00
|
|
|
virtual bool sourceHasNoDataValue( int bandNo ) const;
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
2019-02-26 19:54:09 +10:00
|
|
|
Returns ``True`` if source band has no data value
|
2017-06-01 15:39:31 +02:00
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2016-07-19 11:45:47 +10:00
|
|
|
virtual bool useSourceNoDataValue( int bandNo ) const;
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
2018-05-26 18:44:30 +10:00
|
|
|
Returns the source nodata value usage
|
2017-06-01 15:39:31 +02:00
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2016-07-19 11:45:47 +10:00
|
|
|
virtual void setUseSourceNoDataValue( int bandNo, bool use );
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
2018-05-25 13:54:27 +10:00
|
|
|
Sets the source nodata value usage
|
2017-06-01 15:39:31 +02:00
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2016-07-19 11:45:47 +10:00
|
|
|
virtual double sourceNoDataValue( int bandNo ) const;
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
|
|
|
Value representing no data value.
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual void setUserNoDataValue( int bandNo, const QgsRasterRangeList &noData );
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2014-05-27 23:22:50 +02:00
|
|
|
virtual QgsRasterRangeList userNoDataValues( int bandNo ) const;
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
2018-05-26 18:44:30 +10:00
|
|
|
Returns a list of user no data value ranges.
|
2017-06-01 15:39:31 +02:00
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
|
|
|
virtual QList<QgsColorRampShader::ColorRampItem> colorTable( int bandNo ) const;
|
|
|
|
|
|
|
|
virtual QStringList subLayers() const;
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
2018-05-26 14:10:30 +10:00
|
|
|
Returns the sublayers of this layer - useful for providers that manage
|
2019-02-25 17:20:36 +10:00
|
|
|
their own layers, such as WMS
|
2020-01-26 13:17:25 +03:00
|
|
|
%End
|
|
|
|
|
2020-04-03 15:59:43 +02:00
|
|
|
virtual QgsRasterDataProviderTemporalCapabilities *temporalCapabilities();
|
2020-03-06 08:24:43 +10:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2016-05-27 12:06:22 +02:00
|
|
|
virtual bool supportsLegendGraphic() const;
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
2018-05-26 14:10:30 +10:00
|
|
|
Returns whether the provider supplies a legend graphic
|
2017-06-01 15:39:31 +02:00
|
|
|
%End
|
|
|
|
|
2016-05-27 12:06:22 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual QgsImageFetcher *getLegendGraphicFetcher( const QgsMapSettings *mapSettings ) /Factory/;
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
2018-05-26 18:44:30 +10:00
|
|
|
Returns a new image downloader for the raster legend.
|
2017-06-01 15:39:31 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param mapSettings: map settings for legend providers supporting
|
2018-05-24 21:21:14 +10:00
|
|
|
contextual legends.
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2019-02-26 21:19:42 +10:00
|
|
|
:return: a download handler or ``None`` if the provider does not support
|
2018-05-27 16:33:02 +10:00
|
|
|
legend at all. Ownership of the returned object is transferred
|
2018-05-24 21:21:14 +10:00
|
|
|
to caller.
|
2017-06-01 15:39:31 +02:00
|
|
|
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2018-05-28 11:31:08 -04:00
|
|
|
|
2017-06-01 15:39:31 +02:00
|
|
|
.. versionadded:: 2.8
|
|
|
|
%End
|
|
|
|
|
|
|
|
virtual QString buildPyramids( const QList<QgsRasterPyramid> &pyramidList,
|
|
|
|
const QString &resamplingMethod = "NEAREST",
|
2017-02-21 18:14:58 +01:00
|
|
|
QgsRaster::RasterPyramidsFormat format = QgsRaster::PyramidsGTiff,
|
2017-06-01 15:39:31 +02:00
|
|
|
const QStringList &configOptions = QStringList(),
|
2017-04-02 09:12:28 +10:00
|
|
|
QgsRasterBlockFeedback *feedback = 0 );
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
2018-05-26 14:10:30 +10:00
|
|
|
Create pyramid overviews
|
2017-06-01 15:39:31 +02:00
|
|
|
%End
|
2013-09-17 12:33:57 +02:00
|
|
|
|
2017-06-01 15:39:31 +02:00
|
|
|
virtual QList<QgsRasterPyramid> buildPyramidList( QList<int> overviewList = QList<int>() );
|
|
|
|
%Docstring
|
2018-05-26 17:01:58 +10:00
|
|
|
Returns the raster layers pyramid list.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param overviewList: used to construct the pyramid list (optional), when empty the list is defined by the provider.
|
2018-05-24 21:21:14 +10:00
|
|
|
A pyramid list defines the
|
|
|
|
POTENTIAL pyramids that can be in a raster. To know which of the pyramid layers
|
|
|
|
ACTUALLY exists you need to look at the existsFlag member in each struct stored in the
|
|
|
|
list.
|
2017-06-01 15:39:31 +02:00
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
|
|
|
bool hasPyramids();
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
2019-02-26 19:54:09 +10:00
|
|
|
Returns ``True`` if raster has at least one populated histogram.
|
2017-06-01 15:39:31 +02:00
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-11-21 11:23:11 +01:00
|
|
|
virtual QString htmlMetadata() = 0;
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
2018-05-26 18:44:30 +10:00
|
|
|
Returns metadata in a format suitable for feeding directly
|
2017-12-15 10:36:55 -04:00
|
|
|
into a subset of the GUI raster properties "Metadata" tab.
|
2017-06-01 15:39:31 +02:00
|
|
|
%End
|
|
|
|
|
2017-06-01 12:18:43 +02:00
|
|
|
virtual QgsRasterIdentifyResult identify( const QgsPointXY &point, QgsRaster::IdentifyFormat format, const QgsRectangle &boundingBox = QgsRectangle(), int width = 0, int height = 0, int dpi = 96 );
|
2018-07-12 14:05:47 +10:00
|
|
|
%Docstring
|
|
|
|
Identify raster value(s) found on the point position. The context
|
|
|
|
parameters extent, width and height are important to identify
|
|
|
|
on the same zoom level as a displayed map and to do effective
|
|
|
|
caching (WCS). If context params are not specified the highest
|
2020-06-15 09:04:13 +10:00
|
|
|
resolution is used. :py:func:`~QgsRasterDataProvider.capabilities` may be used to test if format
|
2018-07-12 14:05:47 +10:00
|
|
|
is supported by provider. Values are set to 'no data' or empty string
|
|
|
|
if point is outside data source extent.
|
|
|
|
|
|
|
|
:param point: coordinates in data source CRS
|
|
|
|
:param format: result format
|
|
|
|
:param boundingBox: context bounding box
|
|
|
|
:param width: context width
|
|
|
|
:param height: context height
|
|
|
|
:param dpi: context dpi
|
|
|
|
|
|
|
|
:return: QgsRaster.IdentifyFormatValue: map of values for each band, keys are band numbers
|
|
|
|
(from 1).
|
|
|
|
QgsRaster.IdentifyFormatFeature: map of QgsRasterFeatureList for each sublayer
|
|
|
|
QgsRaster.IdentifyFormatHtml: map of HTML strings for each sublayer (WMS).
|
2020-06-15 11:10:50 +10:00
|
|
|
Empty if failed or there are no results.
|
2018-07-12 14:05:47 +10:00
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
The arbitraryness of the returned document is enforced by WMS standards
|
|
|
|
up to at least v1.3.0
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`sample`
|
|
|
|
%End
|
|
|
|
|
2018-07-16 19:28:08 +10:00
|
|
|
virtual double sample( const QgsPointXY &point, int band,
|
|
|
|
bool *ok /Out/ = 0,
|
|
|
|
const QgsRectangle &boundingBox = QgsRectangle(), int width = 0, int height = 0, int dpi = 96 );
|
2018-07-12 14:05:47 +10:00
|
|
|
%Docstring
|
|
|
|
Samples a raster value from the specified ``band`` found at the ``point`` position. The context
|
|
|
|
parameters ``boundingBox``, ``width`` and ``height`` are important to identify
|
|
|
|
on the same zoom level as a displayed map and to do effective
|
|
|
|
caching (WCS). If context params are not specified the highest
|
2018-07-16 19:28:08 +10:00
|
|
|
resolution is used.
|
2018-07-12 14:05:47 +10:00
|
|
|
|
2018-07-16 19:28:08 +10:00
|
|
|
If ``ok`` is specified and the point is outside data source extent, or an invalid
|
2019-02-26 19:54:09 +10:00
|
|
|
band number was specified, then ``ok`` will be set to ``False``. In this case the function will return
|
2018-07-16 19:28:08 +10:00
|
|
|
a NaN value.
|
2018-07-12 14:05:47 +10:00
|
|
|
|
2018-07-12 14:07:52 +10:00
|
|
|
.. seealso:: :py:func:`identify`
|
|
|
|
|
2018-07-12 14:05:47 +10:00
|
|
|
.. versionadded:: 3.4
|
|
|
|
%End
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2008-10-24 11:00:31 +00:00
|
|
|
virtual QString lastErrorTitle() = 0;
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
2018-05-26 14:10:30 +10:00
|
|
|
Returns the caption error text for the last error in this provider
|
2017-06-01 15:39:31 +02:00
|
|
|
|
2020-06-15 09:04:13 +10:00
|
|
|
If an operation returns 0 (e.g. :py:func:`~QgsRasterDataProvider.draw`), this function
|
2017-12-15 10:36:55 -04:00
|
|
|
returns the text of the error associated with the failure.
|
|
|
|
Interactive users of this provider can then, for example,
|
|
|
|
call a QMessageBox to display the contents.
|
2017-06-01 15:39:31 +02:00
|
|
|
%End
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2008-10-24 11:00:31 +00:00
|
|
|
virtual QString lastError() = 0;
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
2018-05-26 14:10:30 +10:00
|
|
|
Returns the verbose error text for the last error in this provider
|
2017-06-01 15:39:31 +02:00
|
|
|
|
2020-06-15 09:04:13 +10:00
|
|
|
If an operation returns 0 (e.g. :py:func:`~QgsRasterDataProvider.draw`), this function
|
2017-12-15 10:36:55 -04:00
|
|
|
returns the text of the error associated with the failure.
|
|
|
|
Interactive users of this provider can then, for example,
|
|
|
|
call a QMessageBox to display the contents.
|
2017-06-01 15:39:31 +02:00
|
|
|
%End
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2010-08-03 21:24:22 +00:00
|
|
|
virtual QString lastErrorFormat();
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
|
|
|
Returns the format of the error text for the last error in this provider
|
|
|
|
%End
|
2010-08-03 21:24:22 +00:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
int dpi() const;
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
|
|
|
Returns the dpi of the output device.
|
|
|
|
%End
|
2009-06-05 13:13:45 +00:00
|
|
|
|
2010-08-03 21:24:22 +00:00
|
|
|
void setDpi( int dpi );
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
|
|
|
Sets the output device resolution.
|
|
|
|
%End
|
2012-04-13 18:52:32 +02:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
virtual QDateTime timestamp() const;
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
|
|
|
Time stamp of data source in the moment when data/metadata were loaded by provider
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
|
|
|
virtual QDateTime dataTimestamp() const;
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
|
|
|
Current time stamp of data source
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-01-19 11:48:07 +08:00
|
|
|
virtual bool isEditable() const;
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Checks whether the provider is in editing mode, i.e. raster write operations will be accepted.
|
2020-06-15 09:04:13 +10:00
|
|
|
By default providers are not editable. Use :py:func:`~QgsRasterDataProvider.setEditable` method to enable/disable editing.
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setEditable`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-06-01 15:39:31 +02:00
|
|
|
.. versionadded:: 3.0
|
|
|
|
%End
|
2017-01-19 11:48:07 +08:00
|
|
|
|
2017-01-19 12:46:53 +08:00
|
|
|
virtual bool setEditable( bool enabled );
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Turns on/off editing mode of the provider. When in editing mode, it is possible
|
2020-06-15 09:04:13 +10:00
|
|
|
to overwrite data of the provider using :py:func:`~QgsRasterDataProvider.writeBlock` calls.
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2019-02-26 19:54:09 +10:00
|
|
|
:return: ``True`` if the switch to/from editing mode was successful
|
2017-12-16 10:38:54 -04:00
|
|
|
|
2017-06-01 15:39:31 +02:00
|
|
|
.. note::
|
|
|
|
|
|
|
|
Only some providers support editing mode and even those may fail to turn
|
2018-01-12 20:51:17 -04:00
|
|
|
the underlying data source into editing mode, so it is necessary to check the return
|
|
|
|
value whether the operation was successful.
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`isEditable`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-06-01 15:39:31 +02:00
|
|
|
.. versionadded:: 3.0
|
|
|
|
%End
|
2017-01-19 11:48:07 +08:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual bool write( void *data, int band, int width, int height, int xOffset, int yOffset );
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
bool writeBlock( QgsRasterBlock *block, int band, int xOffset = 0, int yOffset = 0 );
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Writes pixel data from a raster block into the provider data source.
|
|
|
|
|
|
|
|
This will override previously stored pixel values. It is assumed that cells in the passed
|
|
|
|
raster block are aligned with the cells of the data source. If raster block does not cover
|
|
|
|
the whole area of the data source, only a subset of pixels covered by the raster block
|
|
|
|
will be overwritten. By default, writing of raster data starts from the first cell
|
|
|
|
of the raster - it is possible to set offset in pixels by specifying non-zero
|
|
|
|
xOffset and yOffset values.
|
2017-06-01 15:39:31 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
Writing is supported only by some data providers. Provider has to be in editing mode
|
|
|
|
in order to allow write operations.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`isEditable`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2019-02-26 19:54:09 +10:00
|
|
|
:return: ``True`` on success
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-06-01 15:39:31 +02:00
|
|
|
.. versionadded:: 3.0
|
|
|
|
%End
|
2017-01-19 11:48:07 +08:00
|
|
|
|
2017-06-01 15:39:31 +02:00
|
|
|
static QgsRasterDataProvider *create( const QString &providerKey,
|
2014-05-18 15:22:26 +02:00
|
|
|
const QString &uri,
|
2017-06-01 15:39:31 +02:00
|
|
|
const QString &format, int nBands,
|
2016-07-21 22:01:38 +10:00
|
|
|
Qgis::DataType type,
|
2017-06-01 15:39:31 +02:00
|
|
|
int width, int height, double *geoTransform,
|
|
|
|
const QgsCoordinateReferenceSystem &crs,
|
2017-05-01 18:13:15 +02:00
|
|
|
const QStringList &createOptions = QStringList() );
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
|
|
|
Creates a new dataset with mDataSourceURI
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
|
|
|
virtual bool setNoDataValue( int bandNo, double noDataValue );
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Set no data value on created dataset
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param bandNo: band number
|
|
|
|
:param noDataValue: no data value
|
2017-06-01 15:39:31 +02:00
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
|
|
|
virtual bool remove();
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
|
|
|
Remove dataset
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
static QList<QPair<QString, QString> > pyramidResamplingMethods( const QString &providerKey );
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns a list of pyramid resampling method name and label pairs
|
|
|
|
for given provider
|
2017-06-01 15:39:31 +02:00
|
|
|
%End
|
2013-01-18 18:18:47 -02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual QString validateCreationOptions( const QStringList &createOptions, const QString &format );
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Validates creation options for a specific dataset and destination format.
|
|
|
|
|
2017-06-01 15:39:31 +02:00
|
|
|
.. note::
|
|
|
|
|
|
|
|
used by GDAL provider only
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-06-01 15:39:31 +02:00
|
|
|
.. note::
|
|
|
|
|
2020-06-15 09:04:13 +10:00
|
|
|
see also :py:func:`~QgsRasterDataProvider.validateCreationOptionsFormat` in gdal provider for validating options based on format only
|
2017-06-01 15:39:31 +02:00
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2013-04-24 17:18:15 +02:00
|
|
|
virtual QString validatePyramidsConfigOptions( QgsRaster::RasterPyramidsFormat pyramidsFormat,
|
2017-05-03 07:45:22 +02:00
|
|
|
const QStringList &configOptions, const QString &fileFormat );
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Validates pyramid creation options for a specific dataset and destination format
|
|
|
|
|
2017-06-01 15:39:31 +02:00
|
|
|
.. note::
|
|
|
|
|
|
|
|
used by GDAL provider only
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2014-05-18 15:22:26 +02:00
|
|
|
static QString identifyFormatName( QgsRaster::IdentifyFormat format );
|
2017-05-01 18:13:15 +02:00
|
|
|
static QgsRaster::IdentifyFormat identifyFormatFromName( const QString &formatName );
|
2014-05-18 15:22:26 +02:00
|
|
|
static QString identifyFormatLabel( QgsRaster::IdentifyFormat format );
|
|
|
|
static Capability identifyFormatToCapability( QgsRaster::IdentifyFormat format );
|
|
|
|
|
2017-02-21 00:57:28 +01:00
|
|
|
virtual int stepWidth() const;
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Step width for raster iterations.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`stepHeight`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-06-01 15:39:31 +02:00
|
|
|
.. versionadded:: 3.0
|
|
|
|
%End
|
|
|
|
|
2017-02-21 00:57:28 +01:00
|
|
|
virtual int stepHeight() const;
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Step height for raster iterations.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`stepWidth`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-06-01 15:39:31 +02:00
|
|
|
.. versionadded:: 3.0
|
2019-06-06 14:13:53 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
virtual QList< double > nativeResolutions() const;
|
|
|
|
%Docstring
|
|
|
|
Returns a list of native resolutions if available, i.e. map units per pixel at which the raster source
|
|
|
|
was originally created.
|
|
|
|
|
2020-06-15 09:04:13 +10:00
|
|
|
Resolutions are calculated in the provider's :py:func:`~QgsRasterDataProvider.crs`.
|
2019-06-06 14:13:53 +10:00
|
|
|
|
|
|
|
.. versionadded:: 3.8.0
|
2019-07-24 12:40:44 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
virtual bool ignoreExtents() const;
|
|
|
|
%Docstring
|
|
|
|
Returns true if the extents reported by the data provider are not reliable
|
|
|
|
and it's possible that there is renderable content outside of these extents.
|
|
|
|
|
|
|
|
.. versionadded:: 3.10.0
|
2020-05-15 23:09:40 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
enum TransformType
|
|
|
|
{
|
|
|
|
TransformImageToLayer,
|
|
|
|
TransformLayerToImage,
|
|
|
|
};
|
|
|
|
|
|
|
|
virtual QgsPoint transformCoordinates( const QgsPoint &point, TransformType type );
|
|
|
|
%Docstring
|
|
|
|
Transforms coordinates between source image coordinate space [0..width]x[0..height] and
|
|
|
|
layer coordinate space (georeferenced coordinates). Often this transformation is a simple
|
|
|
|
2D affine transformation (offset and scaling), but rasters with different georeferencing
|
|
|
|
methods like GCPs (ground control points) or RPCs (rational polynomial coefficients) may
|
|
|
|
require a more complex transform.
|
|
|
|
|
|
|
|
If the transform fails (input coordinates are outside of the valid range or data provider
|
|
|
|
does not support this functionality), an empty point is returned.
|
|
|
|
|
|
|
|
.. versionadded:: 3.14
|
2017-06-01 15:39:31 +02:00
|
|
|
%End
|
2017-02-21 00:57:28 +01:00
|
|
|
|
2020-06-09 23:55:32 +02:00
|
|
|
|
|
|
|
virtual bool enableProviderResampling( bool enable );
|
|
|
|
%Docstring
|
|
|
|
Enable or disable provider-level resampling.
|
|
|
|
|
|
|
|
:return: true if success
|
|
|
|
|
|
|
|
.. versionadded:: 3.16
|
|
|
|
%End
|
|
|
|
|
|
|
|
bool isProviderResamplingEnabled() const;
|
|
|
|
%Docstring
|
|
|
|
Returns whether provider-level resampling is enabled.
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
Resampling is effective only if :py:func:`~QgsRasterDataProvider.zoomedInResamplingMethod` and/or
|
|
|
|
:py:func:`~QgsRasterDataProvider.zoomedOutResamplingMethod` return non-nearest resampling.
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`zoomedInResamplingMethod`
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`zoomedOutResamplingMethod`
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`maxOversampling`
|
|
|
|
|
|
|
|
|
|
|
|
.. versionadded:: 3.16
|
|
|
|
%End
|
|
|
|
|
|
|
|
enum class ResamplingMethod
|
|
|
|
{
|
|
|
|
Nearest,
|
|
|
|
Bilinear,
|
|
|
|
Cubic,
|
|
|
|
};
|
|
|
|
|
|
|
|
virtual bool setZoomedInResamplingMethod( ResamplingMethod method );
|
|
|
|
%Docstring
|
|
|
|
Set resampling method to apply for zoomed-in operations.
|
|
|
|
|
|
|
|
:return: true if success
|
|
|
|
|
|
|
|
.. versionadded:: 3.16
|
|
|
|
%End
|
|
|
|
|
|
|
|
ResamplingMethod zoomedInResamplingMethod() const;
|
|
|
|
%Docstring
|
|
|
|
Returns resampling method for zoomed-in operations.
|
|
|
|
|
|
|
|
.. versionadded:: 3.16
|
|
|
|
%End
|
|
|
|
|
|
|
|
virtual bool setZoomedOutResamplingMethod( ResamplingMethod method );
|
|
|
|
%Docstring
|
|
|
|
Set resampling method to apply for zoomed-out operations.
|
|
|
|
|
|
|
|
:return: true if success
|
|
|
|
|
|
|
|
.. versionadded:: 3.16
|
|
|
|
%End
|
|
|
|
|
|
|
|
ResamplingMethod zoomedOutResamplingMethod() const;
|
|
|
|
%Docstring
|
|
|
|
Returns resampling method for zoomed-out operations.
|
|
|
|
|
|
|
|
.. versionadded:: 3.16
|
|
|
|
%End
|
|
|
|
|
|
|
|
virtual bool setMaxOversampling( double factor );
|
|
|
|
%Docstring
|
|
|
|
Sets maximum oversampling factor for zoomed-out operations.
|
|
|
|
|
|
|
|
:return: true if success
|
|
|
|
|
|
|
|
.. versionadded:: 3.16
|
|
|
|
%End
|
|
|
|
|
|
|
|
double maxOversampling() const;
|
|
|
|
%Docstring
|
|
|
|
Returns maximum oversampling factor for zoomed-out operations.
|
|
|
|
|
|
|
|
.. versionadded:: 3.16
|
|
|
|
%End
|
|
|
|
|
|
|
|
virtual void readXml( const QDomElement &filterElem );
|
|
|
|
|
|
|
|
|
|
|
|
virtual void writeXml( QDomDocument &doc, QDomElement &parentElem ) const;
|
|
|
|
|
|
|
|
|
2014-05-18 15:22:26 +02:00
|
|
|
signals:
|
2016-02-14 03:50:23 +01:00
|
|
|
|
2017-06-01 15:39:31 +02:00
|
|
|
void statusChanged( const QString & ) const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Emit a message to be displayed on status bar, usually used by network providers (WMS,WCS)
|
|
|
|
|
2017-06-01 15:39:31 +02:00
|
|
|
.. versionadded:: 2.14
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
|
|
|
protected:
|
2016-01-04 22:51:18 +11:00
|
|
|
|
|
|
|
|
2017-06-01 15:39:31 +02:00
|
|
|
|
2016-01-04 22:51:18 +11:00
|
|
|
bool userNoDataValuesContains( int bandNo, double value ) const;
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
2019-02-26 19:54:09 +10:00
|
|
|
Returns ``True`` if user no data contains value
|
2017-06-01 15:39:31 +02:00
|
|
|
%End
|
2016-01-04 22:51:18 +11:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
void copyBaseSettings( const QgsRasterDataProvider &other );
|
2017-06-01 15:39:31 +02:00
|
|
|
%Docstring
|
2020-06-15 09:04:13 +10:00
|
|
|
Copy member variables from other raster data provider. Useful for implementation of :py:func:`~QgsRasterDataProvider.clone` method in subclasses
|
2017-06-01 15:39:31 +02:00
|
|
|
%End
|
2016-01-04 22:51:18 +11:00
|
|
|
|
|
|
|
|
2017-06-01 15:39:31 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-01-04 22:51:18 +11:00
|
|
|
|
2020-06-09 23:55:32 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
};
|
2017-09-25 14:20:39 +10:00
|
|
|
|
2018-02-20 09:59:39 +10:00
|
|
|
QFlags<QgsRasterDataProvider::ProviderCapability> operator|(QgsRasterDataProvider::ProviderCapability f1, QFlags<QgsRasterDataProvider::ProviderCapability> f2);
|
|
|
|
|
|
|
|
|
2017-09-25 14:20:39 +10:00
|
|
|
|
2017-06-01 15:39:31 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/raster/qgsrasterdataprovider.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|