/
qgsrasterdataprovider.sip
164 lines (132 loc) · 5.24 KB
/
qgsrasterdataprovider.sip
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
/** Base class for raster data providers
*
* \note This class has been copied and pasted from
* QgsVectorDataProvider, and does not yet make
* sense for Raster layers.
*/
class QgsRasterDataProvider : QgsDataProvider
{
%TypeHeaderCode
#include <qgsrasterdataprovider.h>
%End
public:
//! If you add to this, please also add to capabilitiesString()
enum Capability
{
NoCapabilities = 0,
Identify = 1
// Capability2 = 1 << 1, etc
};
QgsRasterDataProvider();
QgsRasterDataProvider( const QString & uri );
virtual ~QgsRasterDataProvider();
/**
* Add the list of WMS layer names to be rendered by this server
*/
virtual void addLayers( const QStringList & layers,
const QStringList & styles = QStringList() ) = 0;
//! get raster image encodings supported by (e.g.) the WMS Server, expressed as MIME types
virtual QStringList supportedImageEncodings() = 0;
/**
* Get the image encoding (as a MIME type) used in the transfer from (e.g.) the WMS server
*/
virtual QString imageEncoding() const = 0;
/**
* Set the image encoding (as a MIME type) used in the transfer from (e.g.) the WMS server
*/
virtual void setImageEncoding( const QString & mimeType ) = 0;
/**
* Set the image projection (in WMS CRS format) used in the transfer from (e.g.) the WMS server
*/
virtual void setImageCrs( const QString & crs ) = 0;
// TODO: Document this better.
/** \brief Renders the layer as an image
*/
virtual QImage* draw( const QgsRectangle & viewExtent, int pixelWidth, int pixelHeight ) = 0;
/** Returns a bitmask containing the supported capabilities
Note, some capabilities may change depending on whether
a spatial filter is active on this provider, so it may
be prudent to check this value per intended operation.
*/
virtual int capabilities() const;
/**
* Returns the above in friendly format.
*/
QString capabilitiesString() const;
// TODO: Get the supported formats by this provider
// TODO: Get the file masks supported by this provider, suitable for feeding into the file open dialog box
/**
* Get metadata in a format suitable for feeding directly
* into a subset of the GUI raster properties "Metadata" tab.
*/
virtual QString metadata() = 0;
/**
* \brief Identify details from a server (e.g. WMS) from the last screen update
*
* \param point[in] The pixel coordinate (as it was displayed locally on screen)
*
* \return A text document containing the return from the WMS server
*
* \note WMS Servers prefer to receive coordinates in image space, therefore
* this function expects coordinates in that format.
*
* \note The arbitraryness of the returned document is enforced by WMS standards
* up to at least v1.3.0
*/
virtual QString identifyAsText( const QgsPoint& point ) = 0;
/**
* \brief Identify details from a server (e.g. WMS) from the last screen update
*
* \param point[in] The pixel coordinate (as it was displayed locally on screen)
*
* \return A text document containing the return from the WMS server
*
* \note WMS Servers prefer to receive coordinates in image space, therefore
* this function expects coordinates in that format.
*
* \note The arbitraryness of the returned document is enforced by WMS standards
* up to at least v1.3.0
*
* \note added in 1.5
*/
virtual QString identifyAsHtml( const QgsPoint& point ) = 0;
/**
* \brief Returns the caption error text for the last error in this provider
*
* If an operation returns 0 (e.g. draw()), this function
* 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.
*
*/
virtual QString lastErrorTitle() = 0;
/**
* \brief Returns the verbose error text for the last error in this provider
*
* If an operation returns 0 (e.g. draw()), this function
* 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.
*
*/
virtual QString lastError() = 0;
/**
* \brief Returns the format of the error text for the last error in this provider
*
* \note added in 1.6
*/
virtual QString lastErrorFormat();
/**Returns the dpi of the output device.
@note: this method was added in version 1.2*/
int dpi();
/**Sets the output device resolution.
@note: this method was added in version 1.2*/
void setDpi( int dpi );
/** read block of data using give extent and size */
/*virtual void readBlock( int bandNo,
QgsRectangle const & viewExtent,
int width, int height,
QgsCoordinateReferenceSystem theSrcCRS,
QgsCoordinateReferenceSystem theDestCRS,
void *data ); */
};