File: qgsalignraster.sip.in

package info (click to toggle)
qgis 3.40.10%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,183,672 kB
  • sloc: cpp: 1,595,771; python: 372,544; 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: 161
file content (276 lines) | stat: -rw-r--r-- 7,406 bytes parent folder | download | duplicates (12)
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
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/analysis/raster/qgsalignraster.h                                 *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/






class QgsAlignRaster
{
%Docstring(signature="appended")
:py:class:`QgsAlignRaster` takes one or more raster layers and warps
(resamples) them so they have the same:

- coordinate reference system
- cell size and raster size
- offset of the raster grid
%End

%TypeHeaderCode
#include "qgsalignraster.h"
#include "gdal_version.h"
%End
  public:
    QgsAlignRaster();

    struct RasterInfo
    {
      public:
        RasterInfo( const QString &layerpath );
%Docstring
Construct raster info with a path to a raster file
%End


        bool isValid() const;
%Docstring
Check whether the given path is a valid raster
%End

        QString crs() const;
%Docstring
Returns the CRS in WKT format
%End
        QSize rasterSize() const;
%Docstring
Returns the size of the raster grid in pixels
%End
        int bandCount() const;
%Docstring
Returns the number of raster bands in the file
%End
        QSizeF cellSize() const;
%Docstring
Returns the cell size in map units
%End
        QPointF gridOffset() const;
%Docstring
Returns the grid offset
%End
        QgsRectangle extent() const;
%Docstring
Returns the extent of the raster
%End
        QPointF origin() const;
%Docstring
Returns the origin of the raster
%End

        void dump() const;
%Docstring
Write contents of the object to standard error stream - for debugging
%End

        double identify( double mx, double my );
%Docstring
Gets raster value at the given coordinates (from the first band)
%End

      protected:

      private:
        RasterInfo( const QgsAlignRaster::RasterInfo &rh );
    };

    typedef Qgis::GdalResampleAlgorithm ResampleAlg;
    typedef QgsAlignRasterData::RasterItem Item;
    typedef QList<QgsAlignRasterData::RasterItem> List;

    struct ProgressHandler
    {
        virtual bool progress( double complete ) = 0;
%Docstring
Method to be overridden for progress reporting.

:param complete: Overall progress of the alignment operation

:return: ``False`` if the execution should be canceled, ``True``
         otherwise
%End

        virtual ~ProgressHandler();
    };

    void setProgressHandler( ProgressHandler *progressHandler );
%Docstring
Assign a progress handler instance. Does not take ownership. ``None``
can be passed.
%End
    ProgressHandler *progressHandler() const;
%Docstring
Gets associated progress handler. May be ``None`` (default)
%End

    void setRasters( const List &list );
%Docstring
Sets list of rasters that will be aligned
%End
    List rasters() const;
%Docstring
Gets list of rasters that will be aligned
%End

    void setGridOffset( QPointF offset );
    QPointF gridOffset() const;

    void setCellSize( double x, double y );
%Docstring
Sets output cell size
%End
    void setCellSize( QSizeF size );
%Docstring
Sets output cell size
%End
    QSizeF cellSize() const;
%Docstring
Gets output cell size
%End

    void setDestinationCrs( const QString &crsWkt );
%Docstring
Sets the output CRS in WKT format
%End
    QString destinationCrs() const;
%Docstring
Gets the output CRS in WKT format
%End

    void setClipExtent( double xmin, double ymin, double xmax, double ymax );
%Docstring
Configure clipping extent (region of interest). No extra clipping is
done if the rectangle is null
%End

    void setClipExtent( const QgsRectangle &extent );
%Docstring
Configure clipping extent (region of interest). No extra clipping is
done if the rectangle is null
%End

    QgsRectangle clipExtent() const;
%Docstring
Gets clipping extent (region of interest). No extra clipping is done if
the rectangle is null
%End

    bool setParametersFromRaster( const RasterInfo &rasterInfo, const QString &customCRSWkt = QString(), QSizeF customCellSize = QSizeF(), QPointF customGridOffset = QPointF( -1, -1 ) );
%Docstring
Set destination CRS, cell size and grid offset from a raster file. The
user may provide custom values for some of the parameters - in such case
only the remaining parameters are calculated.

If default CRS is used, the parameters are set according to the raster
file's geo-transform. If a custom CRS is provided, suggested
reprojection is calculated first (using GDAL) in order to determine
suitable defaults for cell size and grid offset.

:return: ``True`` on success (may fail if it is not possible to
         reproject raster to given CRS)
%End

    bool setParametersFromRaster( const QString &filename, const QString &customCRSWkt = QString(), QSizeF customCellSize = QSizeF(), QPointF customGridOffset = QPointF( -1, -1 ) );
%Docstring
Overridden variant for convenience, taking filename instead RasterInfo
object. See the other variant for details.
%End

    bool checkInputParameters();
%Docstring
Determine destination extent from the input rasters and calculate
derived values

:return: ``True`` on success, sets error on error (see
         :py:func:`~QgsAlignRaster.errorMessage`)
%End

    QSize alignedRasterSize() const;
%Docstring
Returns the expected size of the resulting aligned raster

.. note::

   first need to run :py:func:`~QgsAlignRaster.checkInputParameters` which returns with success
%End

    QgsRectangle alignedRasterExtent() const;
%Docstring
Returns the expected extent of the resulting aligned raster

.. note::

   first need to run :py:func:`~QgsAlignRaster.checkInputParameters` which returns with success
%End

    bool run();
%Docstring
Run the alignment process

:return: ``True`` on success, sets error on error (see
         :py:func:`~QgsAlignRaster.errorMessage`)
%End

    QString errorMessage() const;
%Docstring
Returns the error from a previous :py:func:`~QgsAlignRaster.run` call.
Error message is empty if :py:func:`~QgsAlignRaster.run` succeeded
(returned ``True``)
%End

    void dump() const;
%Docstring
write contents of the object to standard error stream - for debugging
%End

    int suggestedReferenceLayer() const;
%Docstring
Returns the index of the layer which has smallest cell size (returns -1
on error)
%End

  protected:
    bool createAndWarp( const Item &raster );
%Docstring
Internal function for processing of one raster (1. create output, 2. do
the alignment)
%End

    static bool suggestedWarpOutput( const RasterInfo &info, const QString &destWkt, QSizeF *cellSize = 0, QPointF *gridOffset = 0, QgsRectangle *rect = 0 );
%Docstring
Determine suggested output of raster warp to a different CRS. Returns
``True`` on success
%End

  protected:








};

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