Quantum GIS API Documentation  1.8
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 40 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 113 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 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 
)
void QgsRasterProjector::calcHelper ( int  theMatrixRow,
QgsPoint thePoints 
)
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().

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().

insert columns to matrix

Definition at line 415 of file qgsrasterprojector.cpp.

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

Referenced by QgsRasterProjector().

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().

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().

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().


Member Data Documentation

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().

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

Number of destination columns.

Definition at line 151 of file qgsrasterprojector.h.

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

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.

Destination extent.

Definition at line 139 of file qgsrasterprojector.h.

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

Number of destination rows.

Definition at line 148 of file qgsrasterprojector.h.

Referenced by calcSrcRowsCols(), and QgsRasterProjector().

number of destination rows per matrix row

Definition at line 172 of file qgsrasterprojector.h.

Referenced by matrixRow(), and QgsRasterProjector().

Destination x resolution.

Definition at line 154 of file qgsrasterprojector.h.

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

Destination y resolution.

Definition at line 157 of file qgsrasterprojector.h.

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

Source raster extent.

Definition at line 145 of file qgsrasterprojector.h.

Referenced by calcSrcExtent().

Current mHelperTop matrix row.

Definition at line 189 of file qgsrasterprojector.h.

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

Maximum source resolution.

Definition at line 200 of file qgsrasterprojector.h.

Referenced by calcSrcExtent(), and calcSrcRowsCols().

Definition at line 201 of file qgsrasterprojector.h.

Referenced by calcSrcExtent(), and calcSrcRowsCols().

Maximum tolerance in destination units.

Definition at line 197 of file qgsrasterprojector.h.

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

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.

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().

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().

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().


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