@@ -38,6 +38,14 @@ class QgsPoint;
38
38
class CORE_EXPORT QgsRasterProjector : public QgsRasterInterface
39
39
{
40
40
public:
41
+ /* * Precison defines if each pixel is reprojected or approximate reprojection based
42
+ * on an approximation matrix of reprojected points is used. */
43
+ enum Precision
44
+ {
45
+ Approximate = 0 , // !< Approximate (default), fast but possibly inaccurate
46
+ Exact = 1 , // !< Exact, precise but slow
47
+ };
48
+
41
49
/* * \brief QgsRasterProjector implements approximate projection support for
42
50
* it calculates grid of points in source CRS for target CRS + extent
43
51
* which are used to calculate affine transformation matrices.
@@ -101,12 +109,21 @@ class CORE_EXPORT QgsRasterProjector : public QgsRasterInterface
101
109
mMaxSrcXRes = theMaxSrcXRes; mMaxSrcYRes = theMaxSrcYRes;
102
110
}
103
111
112
+ Precision precision () const { return mPrecision ; }
113
+ void setPrecision ( Precision precision ) { mPrecision = precision; }
114
+ // Translated precision mode, for use in ComboBox etc.
115
+ static QString precisionLabel ( Precision precision );
116
+
104
117
QgsRasterBlock *block ( int bandNo, const QgsRectangle & extent, int width, int height ) override ;
105
118
106
- /* * Calculate destination extent and size from source extent and size
107
- */
119
+ /* * Calculate destination extent and size from source extent and size */
108
120
bool destExtentSize ( const QgsRectangle& theSrcExtent, int theSrcXSize, int theSrcYSize,
109
- QgsRectangle& theDestExtent, int & theDestXSize, int & theDesYSize );
121
+ QgsRectangle& theDestExtent, int & theDestXSize, int & theDestYSize );
122
+
123
+ /* * Calculate destination extent and size from source extent and size */
124
+ static bool extentSize ( const QgsCoordinateTransform* ct,
125
+ const QgsRectangle& theSrcExtent, int theSrcXSize, int theSrcYSize,
126
+ QgsRectangle& theDestExtent, int & theDestXSize, int & theDestYSize );
110
127
111
128
private:
112
129
/* * get source extent */
@@ -265,7 +282,11 @@ class CORE_EXPORT QgsRasterProjector : public QgsRasterInterface
265
282
double mMaxSrcXRes ;
266
283
double mMaxSrcYRes ;
267
284
268
- /* * Use approximation */
285
+ /* * Requested precision */
286
+ Precision mPrecision ;
287
+
288
+ /* * Use approximation (requested precision is Approximate and it is possible to calculate
289
+ * an approximation matrix with a sufficient precision) */
269
290
bool mApproximate ;
270
291
};
271
292
0 commit comments