File: qgsrasterfilewriter.sip.in

package info (click to toggle)
qgis 3.40.11%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,183,800 kB
  • sloc: cpp: 1,595,841; python: 372,637; xml: 23,474; sh: 3,761; perl: 3,664; ansic: 2,257; sql: 2,137; yacc: 1,068; lex: 577; javascript: 540; lisp: 411; makefile: 154
file content (359 lines) | stat: -rw-r--r-- 10,452 bytes parent folder | download | duplicates (6)
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/raster/qgsrasterfilewriter.h                                *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/



class QgsRasterFileWriter
{
%Docstring(signature="appended")
The raster file writer which allows you to save a raster to a new file.

The writer defaults to creating GeoTIFF outputs using GDAL. Alternative
formats and data providers can be used by calling
:py:func:`~setOutputFormat` and :py:func:`~setOutputProviderKey`.
%End

%TypeHeaderCode
#include "qgsrasterfilewriter.h"
%End
  public:

    enum RasterFormatOption /BaseType=IntEnum/
    {
      SortRecommended,
    };
    typedef QFlags<QgsRasterFileWriter::RasterFormatOption> RasterFormatOptions;


    QgsRasterFileWriter( const QString &outputUrl );
%Docstring
Constructor for QgsRasterFileWriter, writing to the specified output
URL/filename.
%End

    QgsRasterDataProvider *createOneBandRaster( Qgis::DataType dataType,
        int width, int height,
        const QgsRectangle &extent,
        const QgsCoordinateReferenceSystem &crs ) /Factory/;
%Docstring
Create a raster file with one band without initializing the pixel data.
Returned provider may be used to initialize the raster using
:py:func:`~QgsRasterFileWriter.writeBlock` calls. Ownership of the
returned provider is passed to the caller.

:return: Instance of data provider in editing mode (on success) or
         ``None`` on error.

.. note::

   Does not work with tiled mode enabled.
%End

    QgsRasterDataProvider *createMultiBandRaster( Qgis::DataType dataType,
        int width, int height,
        const QgsRectangle &extent,
        const QgsCoordinateReferenceSystem &crs,
        int nBands ) /Factory/;
%Docstring
Create a raster file with given number of bands without initializing the
pixel data. Returned provider may be used to initialize the raster using
:py:func:`~QgsRasterFileWriter.writeBlock` calls. Ownership of the
returned provider is passed to the caller.

:return: Instance of data provider in editing mode (on success) or
         ``None`` on error.

.. note::

   Does not work with tiled mode enabled.
%End


 Qgis::RasterFileWriterResult writeRaster( const QgsRasterPipe *pipe, int nCols, int nRows, const QgsRectangle &outputExtent,
        const QgsCoordinateReferenceSystem &crs, QgsRasterBlockFeedback *feedback = 0 ) /Deprecated/;
%Docstring
Write raster file

:param pipe: raster pipe
:param nCols: number of output columns
:param nRows: number of output rows (or -1 to automatically calculate
              row number to have square pixels)
:param outputExtent: extent to output
:param crs: crs to reproject to
:param feedback: optional feedback object for progress reports

.. deprecated:: 3.8

   Use version with transformContext instead.
%End

    Qgis::RasterFileWriterResult writeRaster( const QgsRasterPipe *pipe, int nCols, int nRows, const QgsRectangle &outputExtent,
        const QgsCoordinateReferenceSystem &crs,
        const QgsCoordinateTransformContext &transformContext,
        QgsRasterBlockFeedback *feedback = 0 );
%Docstring
Write raster file

:param pipe: raster pipe
:param nCols: number of output columns
:param nRows: number of output rows (or -1 to automatically calculate
              row number to have square pixels)
:param outputExtent: extent to output
:param crs: crs to reproject to
:param transformContext: coordinate transform context
:param feedback: optional feedback object for progress reports

.. versionadded:: 3.8
%End

    QString outputUrl() const;
%Docstring
Returns the output URL (filename) for the raster.
%End

    void setOutputFormat( const QString &format );
%Docstring
Sets the output ``format``.

For GDAL disk based outputs this should match the GDAL driver name, e.g.
"GTiff" for GeoTiff exports.

.. seealso:: :py:func:`outputFormat`
%End

    QString outputFormat() const;
%Docstring
Returns the output format.

For GDAL disk based outputs this will match the GDAL driver name, e.g.
"GTiff" for GeoTiff exports.

.. seealso:: :py:func:`setOutputFormat`
%End

    void setOutputProviderKey( const QString &key );
%Docstring
Sets the name of the data provider for the raster output.

E.g. set to "gdal" to use GDAL to create disk based raster files.

.. seealso:: :py:func:`outputProviderKey`
%End

    QString outputProviderKey() const;
%Docstring
Returns the name of the data provider for the raster output.

.. seealso:: :py:func:`setOutputProviderKey`
%End

    void setTiledMode( bool t );
%Docstring
Sets whether the output should be tiled.

Tiled outputs will automatically split the raster into multiple parts,
based on the :py:func:`~QgsRasterFileWriter.maxTileWidth` value.

.. seealso:: :py:func:`tiledMode`
%End

    bool tiledMode() const;
%Docstring
Returns whether the output will be tiled.

.. seealso:: :py:func:`setTiledMode`
%End

    void setMaxTileWidth( int w );
%Docstring
Sets the maximum tile width (in pixels) for tiled outputs.

.. seealso:: :py:func:`maxTileWidth`

.. seealso:: :py:func:`setMaxTileHeight`

.. seealso:: :py:func:`tiledMode`
%End

    int maxTileWidth() const;
%Docstring
Returns the maximum tile width (in pixels) for tiled outputs.

.. seealso:: :py:func:`maxTileHeight`

.. seealso:: :py:func:`setMaxTileWidth`

.. seealso:: :py:func:`tiledMode`
%End

    Qgis::RasterBuildPyramidOption buildPyramidsFlag() const;
%Docstring
Returns the pyramid building option.

.. seealso:: :py:func:`setBuildPyramidsFlag`
%End

    void setBuildPyramidsFlag( Qgis::RasterBuildPyramidOption f );
%Docstring
Sets the pyramid building option.

.. seealso:: :py:func:`buildPyramidsFlag`
%End

    QList< int > pyramidsList() const;
%Docstring
Returns the list of pyramids which will be created for the output file.

.. seealso:: :py:func:`setPyramidsList`
%End

    void setPyramidsList( const QList< int > &list );
%Docstring
Sets the ``list`` of pyramids which will be created for the output file.

.. seealso:: :py:func:`pyramidsList`
%End

    QString pyramidsResampling() const;
    void setPyramidsResampling( const QString &str );

    Qgis::RasterPyramidFormat pyramidsFormat() const;
%Docstring
Returns the raster pyramid format.

.. seealso:: :py:func:`setPyramidsFormat`
%End

    void setPyramidsFormat( Qgis::RasterPyramidFormat f );
%Docstring
Sets the raster pyramid format.

.. seealso:: :py:func:`pyramidsFormat`
%End

    void setMaxTileHeight( int h );
%Docstring
Sets the maximum tile height (in pixels) for tiled outputs.

.. seealso:: :py:func:`maxTileHeight`

.. seealso:: :py:func:`setMaxTileWidth`

.. seealso:: :py:func:`tiledMode`
%End

    int maxTileHeight() const;
%Docstring
Returns the maximum tile height (in pixels) for tiled outputs.

.. seealso:: :py:func:`maxTileWidth`

.. seealso:: :py:func:`setMaxTileHeight`

.. seealso:: :py:func:`tiledMode`
%End

    void setCreateOptions( const QStringList &list );
%Docstring
Sets a list of data source creation options to use when creating the
output raster file.

.. seealso:: :py:func:`createOptions`
%End

    QStringList createOptions() const;
%Docstring
Returns the list of data source creation options which will be used when
creating the output raster file.

.. seealso:: :py:func:`setCreateOptions`
%End

    void setPyramidsConfigOptions( const QStringList &list );
%Docstring
Sets a ``list`` of configuration options to use when creating the
pyramids for the output raster file.

.. seealso:: :py:func:`pyramidsConfigOptions`
%End

    QStringList pyramidsConfigOptions() const;
%Docstring
Returns the list of configuration options used when creating the
pyramids for the output raster file.

.. seealso:: :py:func:`setPyramidsConfigOptions`
%End

    static QString filterForDriver( const QString &driverName );
%Docstring
Creates a filter for an GDAL driver key
%End

    struct FilterFormatDetails
    {
      QString driverName;

      QString filterString;
    };

    static QList< QgsRasterFileWriter::FilterFormatDetails > supportedFiltersAndFormats( RasterFormatOptions options = SortRecommended );
%Docstring
Returns a list or pairs, with format filter string as first element and
GDAL format key as second element. Relies on GDAL_DMD_EXTENSIONS
metadata, if it is empty corresponding driver will be skipped even if
supported.

The ``options`` argument can be used to control the sorting and
filtering of returned formats.

.. seealso:: :py:func:`supportedFormatExtensions`
%End

    static QStringList supportedFormatExtensions( RasterFormatOptions options = SortRecommended );
%Docstring
Returns a list of file extensions for supported formats.

The ``options`` argument can be used to control the sorting and
filtering of returned formats.

.. seealso:: :py:func:`supportedFiltersAndFormats`
%End

    static QString driverForExtension( const QString &extension );
%Docstring
Returns the GDAL driver name for a specified file ``extension``. E.g.
the driver name for the ".tif" extension is "GTiff". If no suitable
drivers are found then an empty string is returned.

Note that this method works for all GDAL drivers, including those
without create support (and which are not supported by
QgsRasterFileWriter).
%End

    static QStringList extensionsForFormat( const QString &format );
%Docstring
Returns a list of known file extensions for the given GDAL driver
``format``. E.g. returns "tif", "tiff" for the format "GTiff".

If no matching format driver is found an empty list will be returned.

Note that this method works for all GDAL drivers, including those
without create support (and which are not supported by
QgsRasterFileWriter).
%End

};

/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/raster/qgsrasterfilewriter.h                                *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/