Quantum GIS API Documentation
1.8
|
#include <qgsrasterprojector.h>
Public Member Functions | |
QgsRasterProjector (QgsCoordinateReferenceSystem theSrcCRS, QgsCoordinateReferenceSystem theDestCRS, QgsRectangle theDestExtent, int theDestRows, int theDestCols, double theMaxSrcXRes, double theMaxSrcYRes, QgsRectangle theExtent) | |
QgsRasterProjector implements approximate projection support for it calculates grid of points in source CRS for target CRS + extent which are used to calculate affine transformation matrices. | |
~QgsRasterProjector () | |
The destructor. | |
void | destPointOnCPMatrix (int theRow, int theCol, double *theX, double *theY) |
get destination point for _current_ destination position | |
int | matrixRow (int theDestRow) |
Get matrix upper left row/col indexes for destination row/col. | |
int | matrixCol (int theDestCol) |
QgsPoint | srcPoint (int theRow, int theCol) |
get destination point for _current_ matrix position | |
void | preciseSrcRowCol (int theDestRow, int theDestCol, int *theSrcRow, int *theSrcCol) |
Get precise source row and column indexes for current source extent and resolution. | |
void | approximateSrcRowCol (int theDestRow, int theDestCol, int *theSrcRow, int *theSrcCol) |
Get approximate source row and column indexes for current source extent and resolution. | |
void | srcRowCol (int theDestRow, int theDestCol, int *theSrcRow, int *theSrcCol) |
Get source row and column indexes for current source extent and resolution. | |
void | insertRows () |
insert rows to matrix | |
void | insertCols () |
insert columns to matrix | |
void | calcCP (int theRow, int theCol) |
bool | calcRow (int theRow) |
calculate matrix row | |
bool | calcCol (int theCol) |
calculate matrix column | |
void | calcSrcExtent () |
calculate source extent | |
void | calcSrcRowsCols () |
calculate minimum source width and height | |
bool | checkCols () |
check error along columns returns true if within threshold | |
bool | checkRows () |
check error along rows returns true if within threshold | |
void | calcHelper (int theMatrixRow, QgsPoint *thePoints) |
Calculate array of src helper points. | |
void | nextHelper () |
Calc / switch helper. | |
QgsRectangle | srcExtent () |
get source extent | |
int | srcRows () |
get/set source width/height | |
int | srcCols () |
void | setSrcRows (int theRows) |
void | setSrcCols (int theCols) |
QString | cpToString () |
get mCPMatrix as string | |
Private Attributes | |
QgsCoordinateReferenceSystem | mSrcCRS |
Source CRS. | |
QgsCoordinateReferenceSystem | mDestCRS |
Destination CRS. | |
QgsCoordinateTransform | mCoordinateTransform |
Coordinate transform. | |
QgsRectangle | mDestExtent |
Destination extent. | |
QgsRectangle | mSrcExtent |
Source extent. | |
QgsRectangle | mExtent |
Source raster extent. | |
int | mDestRows |
Number of destination rows. | |
int | mDestCols |
Number of destination columns. | |
double | mDestXRes |
Destination x resolution. | |
double | mDestYRes |
Destination y resolution. | |
int | mSrcRows |
Number of source rows. | |
int | mSrcCols |
Number of source columns. | |
double | mSrcXRes |
Source x resolution. | |
double | mSrcYRes |
Source y resolution. | |
double | mDestRowsPerMatrixRow |
number of destination rows per matrix row | |
double | mDestColsPerMatrixCol |
number of destination cols per matrix col | |
QList< QList< QgsPoint > > | mCPMatrix |
Grid of source control points. | |
QgsPoint * | pHelperTop |
Array of source points for each destination column on top of current CPMatrix grid row. | |
QgsPoint * | pHelperBottom |
Array of source points for each destination column on bottom of current CPMatrix grid row. | |
int | mHelperTopRow |
Current mHelperTop matrix row. | |
int | mCPCols |
Number of mCPMatrix columns. | |
int | mCPRows |
Number of mCPMatrix rows. | |
double | mSqrTolerance |
Maximum tolerance in destination units. | |
double | mMaxSrcXRes |
Maximum source resolution. | |
double | mMaxSrcYRes |
bool | mApproximate |
Use approximation. |
Definition at line 40 of file qgsrasterprojector.h.
QgsRasterProjector::QgsRasterProjector | ( | QgsCoordinateReferenceSystem | theSrcCRS, |
QgsCoordinateReferenceSystem | theDestCRS, | ||
QgsRectangle | theDestExtent, | ||
int | theDestRows, | ||
int | theDestCols, | ||
double | theMaxSrcXRes, | ||
double | theMaxSrcYRes, | ||
QgsRectangle | theExtent | ||
) |
QgsRasterProjector implements approximate projection support for it calculates grid of points in source CRS for target CRS + extent which are used to calculate affine transformation matrices.
Definition at line 22 of file qgsrasterprojector.cpp.
References calcHelper(), calcRow(), calcSrcExtent(), calcSrcRowsCols(), checkCols(), checkRows(), QgsRectangle::height(), insertCols(), insertRows(), mApproximate, mCPCols, mCPMatrix, mCPRows, mDestCols, mDestColsPerMatrixCol, mDestExtent, mDestRows, mDestRowsPerMatrixRow, mDestXRes, mDestYRes, mHelperTopRow, mSqrTolerance, mSrcCols, mSrcExtent, mSrcRows, mSrcXRes, mSrcYRes, pHelperBottom, pHelperTop, QgsDebugMsg, QgsRectangle::toString(), and QgsRectangle::width().
The destructor.
Definition at line 113 of file qgsrasterprojector.cpp.
void QgsRasterProjector::approximateSrcRowCol | ( | int | theDestRow, |
int | theDestCol, | ||
int * | theSrcRow, | ||
int * | theSrcCol | ||
) | [inline] |
Get approximate source row and column indexes for current source extent and resolution.
Definition at line 341 of file qgsrasterprojector.cpp.
References destPointOnCPMatrix(), matrixCol(), matrixRow(), mDestExtent, mDestYRes, mHelperTopRow, mSrcCols, mSrcExtent, mSrcRows, mSrcXRes, mSrcYRes, nextHelper(), pHelperBottom, pHelperTop, QgsPoint::x(), QgsRectangle::xMinimum(), QgsPoint::y(), and QgsRectangle::yMaximum().
Referenced by srcRowCol().
bool QgsRasterProjector::calcCol | ( | int | theCol | ) |
calculate matrix column
Definition at line 453 of file qgsrasterprojector.cpp.
References calcCP(), mCPRows, and QgsDebugMsgLevel.
Referenced by insertCols().
void QgsRasterProjector::calcCP | ( | int | theRow, |
int | theCol | ||
) |
Definition at line 433 of file qgsrasterprojector.cpp.
References destPointOnCPMatrix(), mCoordinateTransform, mCPMatrix, and QgsCoordinateTransform::transform().
void QgsRasterProjector::calcHelper | ( | int | theMatrixRow, |
QgsPoint * | thePoints | ||
) |
Calculate array of src helper points.
Definition at line 263 of file qgsrasterprojector.cpp.
References destPointOnCPMatrix(), matrixCol(), mCPMatrix, mDestCols, mDestExtent, mDestXRes, QgsPoint::setX(), QgsPoint::setY(), QgsPoint::x(), QgsRectangle::xMinimum(), and QgsPoint::y().
Referenced by nextHelper(), and QgsRasterProjector().
bool QgsRasterProjector::calcRow | ( | int | theRow | ) |
calculate matrix row
Definition at line 442 of file qgsrasterprojector.cpp.
References calcCP(), mCPCols, and QgsDebugMsgLevel.
Referenced by insertRows(), and QgsRasterProjector().
void QgsRasterProjector::calcSrcExtent | ( | ) |
calculate source extent
Definition at line 118 of file qgsrasterprojector.cpp.
References QgsRectangle::combineExtentWith(), mCPCols, mCPMatrix, mCPRows, mExtent, mMaxSrcXRes, mMaxSrcYRes, mSrcExtent, QgsDebugMsg, QgsRectangle::setXMaximum(), QgsRectangle::setXMinimum(), QgsRectangle::setYMaximum(), QgsRectangle::setYMinimum(), QgsRectangle::toString(), QgsPoint::x(), QgsRectangle::xMaximum(), QgsRectangle::xMinimum(), QgsPoint::y(), QgsRectangle::yMaximum(), and QgsRectangle::yMinimum().
Referenced by QgsRasterProjector().
void QgsRasterProjector::calcSrcRowsCols | ( | ) |
calculate minimum source width and height
Definition at line 189 of file qgsrasterprojector.cpp.
References QgsRectangle::height(), mCPCols, mCPMatrix, mCPRows, mDestCols, mDestRows, mMaxSrcXRes, mMaxSrcYRes, mSrcCols, mSrcExtent, mSrcRows, QgsDebugMsg, QgsPoint::sqrDist(), and QgsRectangle::width().
Referenced by QgsRasterProjector().
bool QgsRasterProjector::checkCols | ( | ) |
check error along columns returns true if within threshold
Definition at line 464 of file qgsrasterprojector.cpp.
References destPointOnCPMatrix(), mCoordinateTransform, mCPCols, mCPMatrix, mCPRows, mSqrTolerance, QgsCoordinateTransform::ReverseTransform, QgsPoint::sqrDist(), QgsCoordinateTransform::transform(), QgsPoint::x(), and QgsPoint::y().
Referenced by QgsRasterProjector().
bool QgsRasterProjector::checkRows | ( | ) |
check error along rows returns true if within threshold
Definition at line 488 of file qgsrasterprojector.cpp.
References destPointOnCPMatrix(), mCoordinateTransform, mCPCols, mCPMatrix, mCPRows, mSqrTolerance, QgsCoordinateTransform::ReverseTransform, QgsPoint::sqrDist(), QgsCoordinateTransform::transform(), QgsPoint::x(), and QgsPoint::y().
Referenced by QgsRasterProjector().
QString QgsRasterProjector::cpToString | ( | ) |
get mCPMatrix as string
Definition at line 171 of file qgsrasterprojector.cpp.
References mCPCols, mCPMatrix, mCPRows, and QgsPoint::toString().
void QgsRasterProjector::destPointOnCPMatrix | ( | int | theRow, |
int | theCol, | ||
double * | theX, | ||
double * | theY | ||
) | [inline] |
get destination point for _current_ destination position
Definition at line 241 of file qgsrasterprojector.cpp.
References QgsRectangle::height(), mCPCols, mCPRows, mDestExtent, QgsRectangle::width(), QgsRectangle::xMinimum(), and QgsRectangle::yMaximum().
Referenced by approximateSrcRowCol(), calcCP(), calcHelper(), checkCols(), and checkRows().
void QgsRasterProjector::insertCols | ( | ) |
insert columns to matrix
Definition at line 415 of file qgsrasterprojector.cpp.
References calcCol(), mCPCols, mCPMatrix, and mCPRows.
Referenced by QgsRasterProjector().
void QgsRasterProjector::insertRows | ( | ) |
insert rows to matrix
Definition at line 396 of file qgsrasterprojector.cpp.
References calcRow(), mCPCols, mCPMatrix, mCPRows, and QgsDebugMsgLevel.
Referenced by QgsRasterProjector().
int QgsRasterProjector::matrixCol | ( | int | theDestCol | ) | [inline] |
Definition at line 251 of file qgsrasterprojector.cpp.
References mDestColsPerMatrixCol.
Referenced by approximateSrcRowCol(), and calcHelper().
int QgsRasterProjector::matrixRow | ( | int | theDestRow | ) | [inline] |
Get matrix upper left row/col indexes for destination row/col.
Definition at line 247 of file qgsrasterprojector.cpp.
References mDestRowsPerMatrixRow.
Referenced by approximateSrcRowCol().
void QgsRasterProjector::nextHelper | ( | ) |
Calc / switch helper.
Definition at line 288 of file qgsrasterprojector.cpp.
References calcHelper(), mHelperTopRow, pHelperBottom, and pHelperTop.
Referenced by approximateSrcRowCol().
void QgsRasterProjector::preciseSrcRowCol | ( | int | theDestRow, |
int | theDestCol, | ||
int * | theSrcRow, | ||
int * | theSrcCol | ||
) | [inline] |
Get precise source row and column indexes for current source extent and resolution.
Definition at line 305 of file qgsrasterprojector.cpp.
References mCoordinateTransform, mDestExtent, mDestXRes, mDestYRes, mSrcCols, mSrcExtent, mSrcRows, mSrcXRes, mSrcYRes, QgsCoordinateTransform::transformInPlace(), QgsRectangle::xMinimum(), and QgsRectangle::yMaximum().
Referenced by srcRowCol().
void QgsRasterProjector::setSrcCols | ( | int | theCols | ) | [inline] |
Definition at line 123 of file qgsrasterprojector.h.
References mSrcCols, mSrcExtent, mSrcYRes, and QgsRectangle::width().
void QgsRasterProjector::setSrcRows | ( | int | theRows | ) | [inline] |
Definition at line 122 of file qgsrasterprojector.h.
References QgsRectangle::height(), mSrcExtent, mSrcRows, and mSrcXRes.
int QgsRasterProjector::srcCols | ( | ) | [inline] |
Definition at line 121 of file qgsrasterprojector.h.
References mSrcCols.
Referenced by QgsRasterDataProvider::readBlock().
QgsRectangle QgsRasterProjector::srcExtent | ( | ) | [inline] |
get source extent
Definition at line 117 of file qgsrasterprojector.h.
References mSrcExtent.
Referenced by QgsRasterDataProvider::readBlock().
QgsPoint QgsRasterProjector::srcPoint | ( | int | theRow, |
int | theCol | ||
) |
get destination point for _current_ matrix position
Definition at line 256 of file qgsrasterprojector.cpp.
void QgsRasterProjector::srcRowCol | ( | int | theDestRow, |
int | theDestCol, | ||
int * | theSrcRow, | ||
int * | theSrcCol | ||
) |
Get source row and column indexes for current source extent and resolution.
Definition at line 298 of file qgsrasterprojector.cpp.
References approximateSrcRowCol(), mApproximate, and preciseSrcRowCol().
Referenced by QgsRasterDataProvider::readBlock().
int QgsRasterProjector::srcRows | ( | ) | [inline] |
get/set source width/height
Definition at line 120 of file qgsrasterprojector.h.
References mSrcRows.
Referenced by QgsRasterDataProvider::readBlock().
bool QgsRasterProjector::mApproximate [private] |
Use approximation.
Definition at line 204 of file qgsrasterprojector.h.
Referenced by QgsRasterProjector(), and srcRowCol().
Coordinate transform.
Definition at line 136 of file qgsrasterprojector.h.
Referenced by calcCP(), checkCols(), checkRows(), and preciseSrcRowCol().
int QgsRasterProjector::mCPCols [private] |
Number of mCPMatrix columns.
Definition at line 192 of file qgsrasterprojector.h.
Referenced by calcRow(), calcSrcExtent(), calcSrcRowsCols(), checkCols(), checkRows(), cpToString(), destPointOnCPMatrix(), insertCols(), insertRows(), and QgsRasterProjector().
QList< QList<QgsPoint> > QgsRasterProjector::mCPMatrix [private] |
Grid of source control points.
Definition at line 178 of file qgsrasterprojector.h.
Referenced by calcCP(), calcHelper(), calcSrcExtent(), calcSrcRowsCols(), checkCols(), checkRows(), cpToString(), insertCols(), insertRows(), and QgsRasterProjector().
int QgsRasterProjector::mCPRows [private] |
Number of mCPMatrix rows.
Definition at line 194 of file qgsrasterprojector.h.
Referenced by calcCol(), calcSrcExtent(), calcSrcRowsCols(), checkCols(), checkRows(), cpToString(), destPointOnCPMatrix(), insertCols(), insertRows(), and QgsRasterProjector().
int QgsRasterProjector::mDestCols [private] |
Number of destination columns.
Definition at line 151 of file qgsrasterprojector.h.
Referenced by calcHelper(), calcSrcRowsCols(), and QgsRasterProjector().
double QgsRasterProjector::mDestColsPerMatrixCol [private] |
number of destination cols per matrix col
Definition at line 175 of file qgsrasterprojector.h.
Referenced by matrixCol(), and QgsRasterProjector().
Destination CRS.
Definition at line 133 of file qgsrasterprojector.h.
QgsRectangle QgsRasterProjector::mDestExtent [private] |
Destination extent.
Definition at line 139 of file qgsrasterprojector.h.
Referenced by approximateSrcRowCol(), calcHelper(), destPointOnCPMatrix(), preciseSrcRowCol(), and QgsRasterProjector().
int QgsRasterProjector::mDestRows [private] |
Number of destination rows.
Definition at line 148 of file qgsrasterprojector.h.
Referenced by calcSrcRowsCols(), and QgsRasterProjector().
double QgsRasterProjector::mDestRowsPerMatrixRow [private] |
number of destination rows per matrix row
Definition at line 172 of file qgsrasterprojector.h.
Referenced by matrixRow(), and QgsRasterProjector().
double QgsRasterProjector::mDestXRes [private] |
Destination x resolution.
Definition at line 154 of file qgsrasterprojector.h.
Referenced by calcHelper(), preciseSrcRowCol(), and QgsRasterProjector().
double QgsRasterProjector::mDestYRes [private] |
Destination y resolution.
Definition at line 157 of file qgsrasterprojector.h.
Referenced by approximateSrcRowCol(), preciseSrcRowCol(), and QgsRasterProjector().
QgsRectangle QgsRasterProjector::mExtent [private] |
Source raster extent.
Definition at line 145 of file qgsrasterprojector.h.
Referenced by calcSrcExtent().
int QgsRasterProjector::mHelperTopRow [private] |
Current mHelperTop matrix row.
Definition at line 189 of file qgsrasterprojector.h.
Referenced by approximateSrcRowCol(), nextHelper(), and QgsRasterProjector().
double QgsRasterProjector::mMaxSrcXRes [private] |
Maximum source resolution.
Definition at line 200 of file qgsrasterprojector.h.
Referenced by calcSrcExtent(), and calcSrcRowsCols().
double QgsRasterProjector::mMaxSrcYRes [private] |
Definition at line 201 of file qgsrasterprojector.h.
Referenced by calcSrcExtent(), and calcSrcRowsCols().
double QgsRasterProjector::mSqrTolerance [private] |
Maximum tolerance in destination units.
Definition at line 197 of file qgsrasterprojector.h.
Referenced by checkCols(), checkRows(), and QgsRasterProjector().
int QgsRasterProjector::mSrcCols [private] |
Number of source columns.
Definition at line 163 of file qgsrasterprojector.h.
Referenced by approximateSrcRowCol(), calcSrcRowsCols(), preciseSrcRowCol(), QgsRasterProjector(), setSrcCols(), and srcCols().
Source CRS.
Definition at line 130 of file qgsrasterprojector.h.
QgsRectangle QgsRasterProjector::mSrcExtent [private] |
Source extent.
Definition at line 142 of file qgsrasterprojector.h.
Referenced by approximateSrcRowCol(), calcSrcExtent(), calcSrcRowsCols(), preciseSrcRowCol(), QgsRasterProjector(), setSrcCols(), setSrcRows(), and srcExtent().
int QgsRasterProjector::mSrcRows [private] |
Number of source rows.
Definition at line 160 of file qgsrasterprojector.h.
Referenced by approximateSrcRowCol(), calcSrcRowsCols(), preciseSrcRowCol(), QgsRasterProjector(), setSrcRows(), and srcRows().
double QgsRasterProjector::mSrcXRes [private] |
Source x resolution.
Definition at line 166 of file qgsrasterprojector.h.
Referenced by approximateSrcRowCol(), preciseSrcRowCol(), QgsRasterProjector(), and setSrcRows().
double QgsRasterProjector::mSrcYRes [private] |
Source y resolution.
Definition at line 169 of file qgsrasterprojector.h.
Referenced by approximateSrcRowCol(), preciseSrcRowCol(), QgsRasterProjector(), and setSrcCols().
QgsPoint* QgsRasterProjector::pHelperBottom [private] |
Array of source points for each destination column on bottom of current CPMatrix grid row.
Definition at line 186 of file qgsrasterprojector.h.
Referenced by approximateSrcRowCol(), nextHelper(), and QgsRasterProjector().
QgsPoint* QgsRasterProjector::pHelperTop [private] |
Array of source points for each destination column on top of current CPMatrix grid row.
Definition at line 182 of file qgsrasterprojector.h.
Referenced by approximateSrcRowCol(), nextHelper(), and QgsRasterProjector().