16#ifndef QGSALIGNRASTER_H
17#define QGSALIGNRASTER_H
19#include <gdal_version.h>
21#include "qgis_analysis.h"
81 QPointF origin()
const;
87 double identify(
double mx,
double my );
113 typedef QList<QgsAlignRasterData::RasterItem>
List;
165 void setClipExtent(
double xmin,
double ymin,
double xmax,
double ymax );
190 bool setParametersFromRaster(
const RasterInfo &rasterInfo,
const QString &customCRSWkt = QString(), QSizeF customCellSize = QSizeF(), QPointF customGridOffset = QPointF( -1, -1 ) );
196 bool setParametersFromRaster(
const QString &filename,
const QString &customCRSWkt = QString(), QSizeF customCellSize = QSizeF(), QPointF customGridOffset = QPointF( -1, -1 ) );
202 bool checkInputParameters();
208 QSize alignedRasterSize()
const;
232 int suggestedReferenceLayer()
const;
236 bool createAndWarp(
const Item &raster );
239 static bool suggestedWarpOutput(
const RasterInfo &info,
const QString &destWkt, QSizeF *cellSize =
nullptr, QPointF *gridOffset =
nullptr,
QgsRectangle *rect =
nullptr );
GdalResampleAlgorithm
Resampling algorithm to be used (equivalent to GDAL's enum GDALResampleAlg).
ProgressHandler * progressHandler() const
Gets associated progress handler. May be nullptr (default).
void dump() const
write contents of the object to standard error stream - for debugging
int mYSize
Computed raster grid height.
QSizeF cellSize() const
Gets output cell size.
QPointF gridOffset() const
double mGridOffsetX
Destination grid offset - expected to be in interval <0,cellsize).
ProgressHandler * mProgressHandler
Object that facilitates reporting of progress / cancellation.
double mClipExtent[4]
Optional clip extent: sets "requested area" which be extended to fit the raster grid.
void setCellSize(QSizeF size)
Sets output cell size.
List mRasters
List of rasters to be aligned (with their output files and other options).
void setDestinationCrs(const QString &crsWkt)
Sets the output CRS in WKT format.
void setGridOffset(QPointF offset)
List rasters() const
Gets list of rasters that will be aligned.
QString mCrsWkt
Destination CRS - stored in well-known text (WKT) format.
int mXSize
Computed raster grid width.
QString destinationCrs() const
Gets the output CRS in WKT format.
double mCellSizeX
Destination cell size.
void setProgressHandler(ProgressHandler *progressHandler)
Assign a progress handler instance. Does not take ownership. nullptr can be passed.
double mGeoTransform[6]
Computed geo-transform.
QList< QgsAlignRasterData::RasterItem > List
QString errorMessage() const
Returns the error from a previous run() call.
QgsAlignRasterData::RasterItem Item
void setRasters(const List &list)
Sets list of rasters that will be aligned.
void setCellSize(double x, double y)
Sets output cell size.
QString mErrorMessage
Last error message from run().
Qgis::GdalResampleAlgorithm ResampleAlg
A rectangle specified with double values.
std::unique_ptr< std::remove_pointer< GDALDatasetH >::type, GDALDatasetCloser > dataset_unique_ptr
Scoped GDAL dataset.
Definition of one raster layer for alignment.
Helper struct to be sub-classed for progress reporting.
virtual ~ProgressHandler()=default
virtual bool progress(double complete)=0
Method to be overridden for progress reporting.
Utility class for gathering information about rasters.
QString crs() const
Returns the CRS in WKT format.
int mYSize
raster grid size Y
gdal::dataset_unique_ptr mDataset
handle to open GDAL dataset
friend class QgsAlignRaster
RasterInfo(const QString &layerpath)
Construct raster info with a path to a raster file.
double mGeoTransform[6]
geotransform coefficients
int bandCount() const
Returns the number of raster bands in the file.
int mXSize
raster grid size X
QSize rasterSize() const
Returns the size of the raster grid in pixels.
int mBandCnt
number of raster's bands
RasterInfo(const RasterInfo &rh)=delete
RasterInfo & operator=(const RasterInfo &rh)=delete
bool isValid() const
Check whether the given path is a valid raster.
QString mCrsWkt
CRS stored in WKT format.