QGIS API Documentation 4.0.0-Norrköping (1ddcee3d0e4)
Loading...
Searching...
No Matches
qgsrasterfilewritertask.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsrasterfilewritertask.h
3 -------------------------
4 begin : April 2017
5 copyright : (C) 2017 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSRASTERFILEWRITERTASK_H
19#define QGSRASTERFILEWRITERTASK_H
20
21#include "qgis_core.h"
23#include "qgsrasterfilewriter.h"
24#include "qgsrasterinterface.h"
25#include "qgstaskmanager.h"
26
27class QgsRasterPipe;
28
40class CORE_EXPORT QgsRasterFileWriterTask : public QgsTask
41{
42 Q_OBJECT
43
44 public:
52 Q_DECL_DEPRECATED QgsRasterFileWriterTask(
53 const QgsRasterFileWriter &writer, QgsRasterPipe *pipe SIP_TRANSFER, int columns, int rows, const QgsRectangle &outputExtent, const QgsCoordinateReferenceSystem &crs
55
56
65 const QgsRasterFileWriter &writer,
67 int columns,
68 int rows,
69 const QgsRectangle &outputExtent,
71 const QgsCoordinateTransformContext &transformContext
72 );
73
75
76 void cancel() override;
77
78 signals:
79
84 void writeComplete( const QString &outputUrl );
85
91 void errorOccurred( int error );
92
99 void errorOccurred( int error, const QString &errorMessage );
100
101 protected:
102 bool run() override;
103 void finished( bool result ) override;
104
105 private:
106 QgsRasterFileWriter mWriter;
107 int mRows = 0;
108 int mColumns = 0;
109 QgsRectangle mExtent;
111 std::unique_ptr< QgsRasterPipe > mPipe;
112
113 QString mDestFileName;
114
115 std::unique_ptr< QgsRasterBlockFeedback > mFeedback;
116
118
119 QgsCoordinateTransformContext mTransformContext;
120};
121
122#endif //QGSRASTERFILEWRITERTASK_H
RasterFileWriterResult
Raster file export results.
Definition qgis.h:1721
@ Success
Successful export.
Definition qgis.h:1722
Represents a coordinate reference system (CRS).
Contains information about the context in which a coordinate transform is executed.
~QgsRasterFileWriterTask() override
void writeComplete(const QString &outputUrl)
Emitted when writing the layer is successfully completed.
Q_DECL_DEPRECATED QgsRasterFileWriterTask(const QgsRasterFileWriter &writer, QgsRasterPipe *pipe, int columns, int rows, const QgsRectangle &outputExtent, const QgsCoordinateReferenceSystem &crs)
Constructor for QgsRasterFileWriterTask.
void errorOccurred(int error, const QString &errorMessage)
Emitted when an error occurs which prevented the file being written (or if the task is canceled).
void errorOccurred(int error)
Emitted when an error occurs which prevented the file being written (or if the task is canceled).
The raster file writer which allows you to save a raster to a new file.
Contains a pipeline of raster interfaces for sequential raster processing.
A rectangle specified with double values.
virtual void finished(bool result)
If the task is managed by a QgsTaskManager, this will be called after the task has finished (whether ...
virtual bool run()=0
Performs the task's operation.
virtual void cancel()
Notifies the task that it should terminate.
QgsTask(const QString &description=QString(), QgsTask::Flags flags=AllFlags)
Constructor for QgsTask.
#define SIP_DEPRECATED
Definition qgis_sip.h:113
#define SIP_TRANSFER
Definition qgis_sip.h:35