Quantum GIS API Documentation  1.7.4
Public Member Functions | Private Attributes
QgsRasterProjector Class Reference

#include <qgsrasterprojector.h>

Collaboration diagram for QgsRasterProjector:
Collaboration graph
[legend]

List of all members.

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.
QgsPointpHelperTop
 Array of source points for each destination column on top of current CPMatrix grid row.
QgsPointpHelperBottom
 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.

Detailed Description

Definition at line 41 of file qgsrasterprojector.h.


Constructor & Destructor Documentation

QgsRasterProjector::QgsRasterProjector ( QgsCoordinateReferenceSystem  theSrcCRS,
QgsCoordinateReferenceSystem  theDestCRS,
QgsRectangle  theDestExtent,
int  theDestRows,
int  theDestCols,
double  theMaxSrcXRes,
double  theMaxSrcYRes,
QgsRectangle  theExtent 
)

The destructor.

Definition at line 116 of file qgsrasterprojector.cpp.


Member Function Documentation

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 333 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 441 of file qgsrasterprojector.cpp.

References calcCP(), mCPRows, and QgsDebugMsgLevel.

Referenced by insertCols().

void QgsRasterProjector::calcCP ( int  theRow,
int  theCol 
)
void QgsRasterProjector::calcHelper ( int  theMatrixRow,
QgsPoint thePoints 
)
bool QgsRasterProjector::calcRow ( int  theRow)

calculate matrix row

Definition at line 430 of file qgsrasterprojector.cpp.

References calcCP(), mCPCols, and QgsDebugMsgLevel.

Referenced by insertRows(), and QgsRasterProjector().

get mCPMatrix as string

Definition at line 174 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 240 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().

insert columns to matrix

Definition at line 403 of file qgsrasterprojector.cpp.

References calcCol(), mCPCols, mCPMatrix, and mCPRows.

Referenced by QgsRasterProjector().

insert rows to matrix

Definition at line 384 of file qgsrasterprojector.cpp.

References calcRow(), mCPCols, mCPMatrix, mCPRows, and QgsDebugMsgLevel.

Referenced by QgsRasterProjector().

int QgsRasterProjector::matrixCol ( int  theDestCol) [inline]

Definition at line 250 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 246 of file qgsrasterprojector.cpp.

References mDestRowsPerMatrixRow.

Referenced by approximateSrcRowCol().

Calc / switch helper.

Definition at line 285 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 301 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 124 of file qgsrasterprojector.h.

References mSrcCols, mSrcExtent, mSrcYRes, and QgsRectangle::width().

void QgsRasterProjector::setSrcRows ( int  theRows) [inline]

Definition at line 123 of file qgsrasterprojector.h.

References QgsRectangle::height(), mSrcExtent, mSrcRows, and mSrcXRes.

int QgsRasterProjector::srcCols ( ) [inline]

Definition at line 122 of file qgsrasterprojector.h.

References mSrcCols.

Referenced by QgsRasterDataProvider::readBlock().

get source extent

Definition at line 118 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 255 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 295 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 121 of file qgsrasterprojector.h.

References mSrcRows.

Referenced by QgsRasterDataProvider::readBlock().


Member Data Documentation

Use approximation.

Definition at line 205 of file qgsrasterprojector.h.

Referenced by QgsRasterProjector(), and srcRowCol().

Coordinate transform.

Definition at line 137 of file qgsrasterprojector.h.

Referenced by calcCP(), checkCols(), checkRows(), and preciseSrcRowCol().

QList< QList<QgsPoint> > QgsRasterProjector::mCPMatrix [private]

Number of destination columns.

Definition at line 152 of file qgsrasterprojector.h.

Referenced by calcHelper(), calcSrcRowsCols(), and QgsRasterProjector().

number of destination cols per matrix col

Definition at line 176 of file qgsrasterprojector.h.

Referenced by matrixCol(), and QgsRasterProjector().

Destination CRS.

Definition at line 134 of file qgsrasterprojector.h.

Destination extent.

Definition at line 140 of file qgsrasterprojector.h.

Referenced by approximateSrcRowCol(), calcHelper(), destPointOnCPMatrix(), preciseSrcRowCol(), and QgsRasterProjector().

Number of destination rows.

Definition at line 149 of file qgsrasterprojector.h.

Referenced by calcSrcRowsCols(), and QgsRasterProjector().

number of destination rows per matrix row

Definition at line 173 of file qgsrasterprojector.h.

Referenced by matrixRow(), and QgsRasterProjector().

Destination x resolution.

Definition at line 155 of file qgsrasterprojector.h.

Referenced by calcHelper(), preciseSrcRowCol(), and QgsRasterProjector().

Destination y resolution.

Definition at line 158 of file qgsrasterprojector.h.

Referenced by approximateSrcRowCol(), preciseSrcRowCol(), and QgsRasterProjector().

Source raster extent.

Definition at line 146 of file qgsrasterprojector.h.

Referenced by calcSrcExtent().

Current mHelperTop matrix row.

Definition at line 190 of file qgsrasterprojector.h.

Referenced by approximateSrcRowCol(), nextHelper(), and QgsRasterProjector().

Maximum source resolution.

Definition at line 201 of file qgsrasterprojector.h.

Referenced by calcSrcExtent(), and calcSrcRowsCols().

Definition at line 202 of file qgsrasterprojector.h.

Referenced by calcSrcExtent(), and calcSrcRowsCols().

Maximum tolerance in destination units.

Definition at line 198 of file qgsrasterprojector.h.

Referenced by checkCols(), checkRows(), and QgsRasterProjector().

Number of source columns.

Definition at line 164 of file qgsrasterprojector.h.

Referenced by approximateSrcRowCol(), calcSrcRowsCols(), preciseSrcRowCol(), QgsRasterProjector(), setSrcCols(), and srcCols().

Source CRS.

Definition at line 131 of file qgsrasterprojector.h.

Number of source rows.

Definition at line 161 of file qgsrasterprojector.h.

Referenced by approximateSrcRowCol(), calcSrcRowsCols(), preciseSrcRowCol(), QgsRasterProjector(), setSrcRows(), and srcRows().

double QgsRasterProjector::mSrcXRes [private]

Source x resolution.

Definition at line 167 of file qgsrasterprojector.h.

Referenced by approximateSrcRowCol(), preciseSrcRowCol(), QgsRasterProjector(), and setSrcRows().

double QgsRasterProjector::mSrcYRes [private]

Source y resolution.

Definition at line 170 of file qgsrasterprojector.h.

Referenced by approximateSrcRowCol(), preciseSrcRowCol(), QgsRasterProjector(), and setSrcCols().

Array of source points for each destination column on bottom of current CPMatrix grid row.

Definition at line 187 of file qgsrasterprojector.h.

Referenced by approximateSrcRowCol(), nextHelper(), and QgsRasterProjector().

Array of source points for each destination column on top of current CPMatrix grid row.

Definition at line 183 of file qgsrasterprojector.h.

Referenced by approximateSrcRowCol(), nextHelper(), and QgsRasterProjector().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines