|
QGIS API Documentation
2.12.0-Lyon
|
QgsAlignRaster takes one or more raster layers and warps (resamples) them so they have the same: More...
#include <qgsalignraster.h>
Classes | |
| struct | Item |
| Definition of one raster layer for alignment. More... | |
| struct | ProgressHandler |
| Helper struct to be sub-classed for progress reporting. More... | |
| struct | RasterInfo |
| Utility class for gathering information about rasters. More... | |
Public Types | |
| typedef QList< Item > | List |
| enum | ResampleAlg { RA_NearestNeighbour = 0, RA_Bilinear = 1, RA_Cubic = 2, RA_CubicSpline = 3, RA_Lanczos = 4, RA_Average = 5, RA_Mode = 6 } |
| Resampling algorithm to be used (equivalent to GDAL's enum GDALResampleAlg) More... | |
Public Member Functions | |
| QgsAlignRaster () | |
| QgsRectangle | alignedRasterExtent () const |
| Return expected extent of the resulting aligned raster. More... | |
| QSize | alignedRasterSize () const |
| Return expected size of the resulting aligned raster. More... | |
| QSizeF | cellSize () const |
| Get output cell size. More... | |
| bool | checkInputParameters () |
| Determine destination extent from the input rasters and calculate derived values. More... | |
| QgsRectangle | clipExtent () const |
| Get clipping extent (region of interest). More... | |
| QString | destinationCRS () const |
| Get the output CRS in WKT format. More... | |
| void | dump () const |
| write contents of the object to standard error stream - for debugging More... | |
| QString | errorMessage () const |
| Return error from a previous run() call. More... | |
| QPointF | gridOffset () const |
| ProgressHandler * | progressHandler () const |
| Get associated progress handler. May be NULL (default) More... | |
| List | rasters () const |
| Get list of rasters that will be aligned. More... | |
| bool | run () |
| Run the alignment process. More... | |
| void | setCellSize (double x, double y) |
| Set output cell size. More... | |
| void | setCellSize (const QSizeF &size) |
| Set output cell size. More... | |
| void | setClipExtent (double xmin, double ymin, double xmax, double ymax) |
| Configure clipping extent (region of interest). More... | |
| void | setClipExtent (const QgsRectangle &extent) |
| Configure clipping extent (region of interest). More... | |
| void | setDestinationCRS (const QString &crsWkt) |
| Set the output CRS in WKT format. More... | |
| void | setGridOffset (const QPointF &offset) |
| bool | setParametersFromRaster (const RasterInfo &rasterInfo, const QString &customCRSWkt=QString(), QSizeF customCellSize=QSizeF(), QPointF customGridOffset=QPointF(-1,-1)) |
| Set destination CRS, cell size and grid offset from a raster file. More... | |
| bool | setParametersFromRaster (const QString &filename, const QString &customCRSWkt=QString(), QSizeF customCellSize=QSizeF(), QPointF customGridOffset=QPointF(-1,-1)) |
| Overridden variant for convenience, taking filename instead RasterInfo object. More... | |
| void | setProgressHandler (ProgressHandler *progressHandler) |
| Assign a progress handler instance. Does not take ownership. NULL can be passed. More... | |
| void | setRasters (const List &list) |
| Set list of rasters that will be aligned. More... | |
| int | suggestedReferenceLayer () const |
| Return index of the layer which has smallest cell size (returns -1 on error) More... | |
Protected Member Functions | |
| bool | createAndWarp (const Item &raster) |
| Internal function for processing of one raster (1. create output, 2. do the alignment) More... | |
Static Protected Member Functions | |
| static bool | suggestedWarpOutput (const RasterInfo &info, const QString &destWkt, QSizeF *cellSize=0, QPointF *gridOffset=0, QgsRectangle *rect=0) |
| Determine suggested output of raster warp to a different CRS. Returns true on success. More... | |
Protected Attributes | |
| double | mCellSizeX |
| Destination cell size. More... | |
| double | mCellSizeY |
| double | mClipExtent [4] |
| Optional clip extent: sets "requested area" which be extended to fit the raster grid. More... | |
| QString | mCrsWkt |
| Destination CRS - stored in well-known text (WKT) format. More... | |
| QString | mErrorMessage |
| Last error message from run() More... | |
| double | mGeoTransform [6] |
| Computed geo-transform. More... | |
| double | mGridOffsetX |
| Destination grid offset - expected to be in interval <0,cellsize) More... | |
| double | mGridOffsetY |
| ProgressHandler * | mProgressHandler |
| Object that facilitates reporting of progress / cancellation. More... | |
| List | mRasters |
| List of rasters to be aligned (with their output files and other options) More... | |
| int | mXSize |
| Computed raster grid width/height. More... | |
| int | mYSize |
QgsAlignRaster takes one or more raster layers and warps (resamples) them so they have the same:
Definition at line 38 of file qgsalignraster.h.
| typedef QList<Item> QgsAlignRaster::List |
Definition at line 128 of file qgsalignraster.h.
Resampling algorithm to be used (equivalent to GDAL's enum GDALResampleAlg)
Definition at line 92 of file qgsalignraster.h.
| QgsAlignRaster::QgsAlignRaster | ( | ) |
Definition at line 119 of file qgsalignraster.cpp.
| QgsRectangle QgsAlignRaster::alignedRasterExtent | ( | ) | const |
Return expected extent of the resulting aligned raster.
Definition at line 353 of file qgsalignraster.cpp.
| QSize QgsAlignRaster::alignedRasterSize | ( | ) | const |
Return expected size of the resulting aligned raster.
Definition at line 348 of file qgsalignraster.cpp.
|
inline |
Get output cell size.
Definition at line 159 of file qgsalignraster.h.
| bool QgsAlignRaster::checkInputParameters | ( | ) |
Determine destination extent from the input rasters and calculate derived values.
Definition at line 239 of file qgsalignraster.cpp.
| QgsRectangle QgsAlignRaster::clipExtent | ( | ) | const |
Get clipping extent (region of interest).
No extra clipping is done if the rectangle is null
Definition at line 147 of file qgsalignraster.cpp.
|
protected |
Internal function for processing of one raster (1. create output, 2. do the alignment)
Definition at line 422 of file qgsalignraster.cpp.
|
inline |
Get the output CRS in WKT format.
Definition at line 164 of file qgsalignraster.h.
| void QgsAlignRaster::dump | ( | ) | const |
write contents of the object to standard error stream - for debugging
Definition at line 378 of file qgsalignraster.cpp.
|
inline |
Return error from a previous run() call.
Error message is empty if run() succeeded (returned true)
Definition at line 207 of file qgsalignraster.h.
|
inline |
Definition at line 152 of file qgsalignraster.h.
|
inline |
Get associated progress handler. May be NULL (default)
Definition at line 144 of file qgsalignraster.h.
|
inline |
Get list of rasters that will be aligned.
Definition at line 149 of file qgsalignraster.h.
| bool QgsAlignRaster::run | ( | ) |
Run the alignment process.
Definition at line 359 of file qgsalignraster.cpp.
|
inline |
Set output cell size.
Definition at line 155 of file qgsalignraster.h.
|
inline |
Set output cell size.
Definition at line 157 of file qgsalignraster.h.
| void QgsAlignRaster::setClipExtent | ( | double | xmin, |
| double | ymin, | ||
| double | xmax, | ||
| double | ymax | ||
| ) |
Configure clipping extent (region of interest).
No extra clipping is done if the rectangle is null
Definition at line 133 of file qgsalignraster.cpp.
| void QgsAlignRaster::setClipExtent | ( | const QgsRectangle & | extent | ) |
Configure clipping extent (region of interest).
No extra clipping is done if the rectangle is null
Definition at line 141 of file qgsalignraster.cpp.
|
inline |
Set the output CRS in WKT format.
Definition at line 162 of file qgsalignraster.h.
|
inline |
Definition at line 151 of file qgsalignraster.h.
| bool QgsAlignRaster::setParametersFromRaster | ( | const RasterInfo & | rasterInfo, |
| const QString & | customCRSWkt = QString(), |
||
| QSizeF | customCellSize = QSizeF(), |
||
| QPointF | customGridOffset = QPointF( -1, -1 ) |
||
| ) |
Set destination CRS, cell size and grid offset from a raster file.
The user may provide custom values for some of the parameters - in such case only the remaining parameters are calculated.
If default CRS is used, the parameters are set according to the raster file's geo-transform. If a custom CRS is provided, suggested reprojection is calculated first (using GDAL) in order to determine suitable defaults for cell size and grid offset.
Definition at line 159 of file qgsalignraster.cpp.
| bool QgsAlignRaster::setParametersFromRaster | ( | const QString & | filename, |
| const QString & | customCRSWkt = QString(), |
||
| QSizeF | customCellSize = QSizeF(), |
||
| QPointF | customGridOffset = QPointF( -1, -1 ) |
||
| ) |
Overridden variant for convenience, taking filename instead RasterInfo object.
See the other variant for details.
Definition at line 154 of file qgsalignraster.cpp.
|
inline |
Assign a progress handler instance. Does not take ownership. NULL can be passed.
Definition at line 142 of file qgsalignraster.h.
|
inline |
Set list of rasters that will be aligned.
Definition at line 147 of file qgsalignraster.h.
| int QgsAlignRaster::suggestedReferenceLayer | ( | ) | const |
Return index of the layer which has smallest cell size (returns -1 on error)
Definition at line 391 of file qgsalignraster.cpp.
|
staticprotected |
Determine suggested output of raster warp to a different CRS. Returns true on success.
Definition at line 519 of file qgsalignraster.cpp.
|
protected |
Destination cell size.
Definition at line 239 of file qgsalignraster.h.
|
protected |
Definition at line 239 of file qgsalignraster.h.
|
protected |
Optional clip extent: sets "requested area" which be extended to fit the raster grid.
Clipping not done if all coords are zeroes.
Definition at line 245 of file qgsalignraster.h.
|
protected |
Destination CRS - stored in well-known text (WKT) format.
Definition at line 237 of file qgsalignraster.h.
|
protected |
Last error message from run()
Definition at line 231 of file qgsalignraster.h.
|
protected |
Computed geo-transform.
Definition at line 250 of file qgsalignraster.h.
|
protected |
Destination grid offset - expected to be in interval <0,cellsize)
Definition at line 241 of file qgsalignraster.h.
|
protected |
Definition at line 241 of file qgsalignraster.h.
|
protected |
Object that facilitates reporting of progress / cancellation.
Definition at line 228 of file qgsalignraster.h.
|
protected |
List of rasters to be aligned (with their output files and other options)
Definition at line 234 of file qgsalignraster.h.
|
protected |
Computed raster grid width/height.
Definition at line 252 of file qgsalignraster.h.
|
protected |
Definition at line 252 of file qgsalignraster.h.
1.8.9.1