File: qgstiles.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 (428 lines) | stat: -rw-r--r-- 10,910 bytes parent folder | download | duplicates (8)
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
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/qgstiles.h                                                  *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/





class QgsTileXYZ
{
%Docstring(signature="appended")
Stores coordinates of a tile in a tile matrix set.

Tile matrix is identified by the :py:func:`~zoomLevel`, and the position
within tile matrix is given by :py:func:`~column` and :py:func:`~row`.

.. versionadded:: 3.14
%End

%TypeHeaderCode
#include "qgstiles.h"
%End
  public:
    QgsTileXYZ( int tc = -1, int tr = -1, int tz = -1 );
%Docstring
Constructs a tile identifier from given column, row and zoom level
indices
%End

    int column() const;
%Docstring
Returns tile's column index (X)
%End
    int row() const;
%Docstring
Returns tile's row index (Y)
%End
    int zoomLevel() const;
%Docstring
Returns tile's zoom level (Z)
%End

    QString toString() const;
%Docstring
Returns tile coordinates in a formatted string
%End

    bool operator==( const QgsTileXYZ &other ) const;
    bool operator!=( const QgsTileXYZ &other ) const;

    SIP_PYOBJECT __repr__();
%MethodCode
    const QString str = QStringLiteral( "<QgsTileXYZ: %1, %2, %3>" ).arg( sipCpp->column() ).arg( sipCpp->row() ).arg( sipCpp->zoomLevel() );
    sipRes = PyUnicode_FromString( str.toUtf8().constData() );
%End

};



class QgsTileRange
{
%Docstring(signature="appended")
Range of tiles in a tile matrix to be rendered. The selection is
rectangular, given by start/end row and column numbers.

.. versionadded:: 3.14
%End

%TypeHeaderCode
#include "qgstiles.h"
%End
  public:
    QgsTileRange( int c1 = -1, int c2 = -1, int r1 = -1, int r2 = -1 );
%Docstring
Constructs a range of tiles from given span of columns and rows
%End
    bool isValid() const;
%Docstring
Returns whether the range is valid (when all row/column numbers are not
negative)
%End

    int startColumn() const;
%Docstring
Returns index of the first column in the range
%End
    int endColumn() const;
%Docstring
Returns index of the last column in the range
%End
    int startRow() const;
%Docstring
Returns index of the first row in the range
%End
    int endRow() const;
%Docstring
Returns index of the last row in the range
%End

    int count() const;
%Docstring
Returns the total number of tiles in the range.

.. versionadded:: 3.44
%End

};


class QgsTileMatrix
{
%Docstring(signature="appended")
Defines a matrix of tiles for a single zoom level: it is defined by its
size (width * height) and map extent that it covers.

Please note that we follow the XYZ convention of X/Y axes, i.e. top-left
tile has [0,0] coordinate (which is different from TMS convention where
bottom-left tile has [0,0] coordinate).

.. versionadded:: 3.14
%End

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

    static QgsTileMatrix fromWebMercator( int zoomLevel );
%Docstring
Returns a tile matrix for the usual web mercator
%End

    static QgsTileMatrix fromCustomDef( int zoomLevel, const QgsCoordinateReferenceSystem &crs,
                                        const QgsPointXY &z0TopLeftPoint, double z0Dimension,
                                        int z0MatrixWidth = 1, int z0MatrixHeight = 1 );
%Docstring
Returns a tile matrix for a specific CRS, top left point, zoom level 0
dimension in CRS units.

The ``z0Dimension`` argument must specify the dimension (width or
height, in map units) of the root tiles in zoom level 0.
%End

    static QgsTileMatrix fromTileMatrix( int zoomLevel, const QgsTileMatrix &tileMatrix );
%Docstring
Returns a tile matrix based on another one
%End

    QgsCoordinateReferenceSystem crs() const;
%Docstring
Returns the crs of the tile matrix.

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

    void setCrs( const QgsCoordinateReferenceSystem &crs );
%Docstring
Sets the ``crs`` of the tile matrix.

.. seealso:: :py:func:`crs`

.. versionadded:: 3.22.6
%End

    int zoomLevel() const;
%Docstring
Returns the zoom level of the tile matrix.

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

    void setZoomLevel( int level );
%Docstring
Sets the zoom ``level`` of the tile matrix.

.. seealso:: :py:func:`zoomLevel`

.. versionadded:: 3.22.6
%End

    int matrixWidth() const;
%Docstring
Returns number of columns of the tile matrix
%End

    int matrixHeight() const;
%Docstring
Returns number of rows of the tile matrix
%End

    QgsRectangle extent() const;
%Docstring
Returns extent of the tile matrix
%End

    double scale() const;
%Docstring
Returns scale denominator of the tile matrix.

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

    void setScale( double scale );
%Docstring
Sets the scale denominator of the tile matrix.

.. seealso:: :py:func:`scale`

.. versionadded:: 3.22.6
%End

    QgsRectangle tileExtent( QgsTileXYZ id ) const;
%Docstring
Returns extent of the given tile in this matrix
%End

    QgsPointXY tileCenter( QgsTileXYZ id ) const;
%Docstring
Returns center of the given tile in this matrix
%End

    QgsTileRange tileRangeFromExtent( const QgsRectangle &mExtent ) const;
%Docstring
Returns tile range that fully covers the given extent
%End

    QPointF mapToTileCoordinates( const QgsPointXY &mapPoint ) const;
%Docstring
Returns row/column coordinates (floating point number) from the given
point in map coordinates
%End

    bool isRootTileMatrix() const;
%Docstring
Returns the root status of the tile matrix (zoom level == 0)
%End

};


class QgsTileMatrixSet
{
%Docstring(signature="appended")
Defines a set of tile matrices for multiple zoom levels.

.. versionadded:: 3.22.6
%End

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

    QgsTileMatrixSet();

    virtual ~QgsTileMatrixSet();

    bool isEmpty() const;
%Docstring
Returns ``True`` if the matrix set is empty.
%End

    void addGoogleCrs84QuadTiles( int minimumZoom = 0, int maximumZoom = 14 );
%Docstring
Adds tile matrices corresponding to the standard web
mercator/GoogleCRS84Quad setup.
%End

    QgsTileMatrix tileMatrix( int zoom ) const;
%Docstring
Returns the tile matrix corresponding to the specified ``zoom``.
%End

    QgsTileMatrix rootMatrix() const;
%Docstring
Returns the root tile matrix (usually corresponding to zoom level 0).

.. versionadded:: 3.28
%End

    void setRootMatrix( const QgsTileMatrix &matrix );
%Docstring
Sets the root tile ``matrix`` (usually corresponding to zoom level 0).

.. versionadded:: 3.28
%End

    void addMatrix( const QgsTileMatrix &matrix );
%Docstring
Adds a ``matrix`` to the set.

Any existing matrix with the same :py:func:`QgsTileMatrix.zoomLevel()`
will be replaced.
%End

    int minimumZoom() const;
%Docstring
Returns the minimum zoom level for tiles present in the set.

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

    int maximumZoom() const;
%Docstring
Returns the maximum zoom level for tiles present in the set.

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

    void dropMatricesOutsideZoomRange( int minimumZoom, int maximumZoom );
%Docstring
Deletes any existing matrices which fall outside the zoom range
specified by ``minimumZoom`` to ``maximumZoom``, inclusive.
%End

    Qgis::TileAvailability tileAvailability( QgsTileXYZ id ) const;
%Docstring
Returns the availability of the given tile in this matrix.

This method can be used to determine whether a particular tile actually
exists within the matrix, or is not available (e.g. due to holes within
the matrix).

This method returns :py:class:`Qgis`.TileAvailability.Available by
default, unless specific tile availability is known for the given
``id``.

.. versionadded:: 3.32
%End

    QgsCoordinateReferenceSystem crs() const;
%Docstring
Returns the coordinate reference system associated with the tiles.

In the case of a tile set containing mixed CRS at different zoom levels
this method will return the crs of the minimum zoom tile matrix.
%End

    double scaleToZoom( double scale ) const;
%Docstring
Calculates a fractional zoom level given a map ``scale`` denominator.

The zoom level will be linearly interpolated between zoom levels present
in the set.
%End

    int scaleToZoomLevel( double scale, bool clamp = true ) const;
%Docstring
Finds the best fitting (integer) zoom level given a map ``scale``
denominator. An optional ``clamp`` parameter can be set to ``False`` to
disable clamping zoom level to the tile matrix set's minimum and maximum
zoom level.

Values are constrained to the zoom levels between
:py:func:`~QgsTileMatrixSet.minimumZoom` and
:py:func:`~QgsTileMatrixSet.maximumZoom`.
%End

    double scaleForRenderContext( const QgsRenderContext &context ) const;
%Docstring
Calculates the correct scale to use for the tiles when rendered using
the specified render ``context``.

.. versionadded:: 3.26
%End

    double calculateTileScaleForMap( double actualMapScale,
                                     const QgsCoordinateReferenceSystem &mapCrs,
                                     const QgsRectangle &mapExtent,
                                     const QSize mapSize,
                                     const double mapDpi
                                   ) const;
%Docstring
Calculates the correct scale to use for the tiles when rendered using
the specified map properties.

.. versionadded:: 3.26
%End

    virtual bool readXml( const QDomElement &element, QgsReadWriteContext &context );
%Docstring
Reads the set from an XML ``element``.

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

    virtual QDomElement writeXml( QDomDocument &document, const QgsReadWriteContext &context ) const;
%Docstring
Writes the set to an XML element.
%End

    Qgis::ScaleToTileZoomLevelMethod scaleToTileZoomMethod() const;
%Docstring
Returns the scale to tile zoom method.

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

    void setScaleToTileZoomMethod( Qgis::ScaleToTileZoomLevelMethod method );
%Docstring
Sets the scale to tile zoom method.

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

    QVector<QgsTileXYZ> tilesInRange( QgsTileRange range, int zoomLevel ) const;
%Docstring
Returns a list of tiles in the given tile range.

.. versionadded:: 3.32
%End

  protected:

};

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