Skip to content
Permalink
Browse files
Update api break docs, sipify QgsRasterFileWriter
  • Loading branch information
nyalldawson committed Apr 6, 2017
1 parent 9c832ad commit 5ccc6cccef9fc48ef46e8ff2028e7f4f9743b179
@@ -1681,6 +1681,15 @@ QgsRasterDataProvider {#qgis_api_break_3_0_QgsRasterDataProvider}
- The progress and progressUpdate signals were removed. Methods which previously emitted these
signals now accept a QgsRasterBlockFeedback argument for reporting progress updates.


QgsRasterFileWriter {#qgis_api_break_3_0_QgsRasterFileWriter}
------------------

- writeRaster now uses a QgsRasterBlockFeedback object instead of a QProgressDialog argument. Any use of the old
QProgressDialog argument will need to be updated using manually created connections between QgsRasterBlockFeedback's
signals and the updates to the progress dialog.


QgsRasterInterface {#qgis_api_break_3_0_QgsRasterInterface}
------------------

@@ -252,7 +252,6 @@ core/raster/qgsrasterblock.sip
core/raster/qgsrasterchecker.sip
core/raster/qgsrasterdataprovider.sip
core/raster/qgsrasterdrawer.sip
core/raster/qgsrasterfilewriter.sip
core/raster/qgsrasterhistogram.sip
core/raster/qgsrasteridentifyresult.sip
core/raster/qgsrasterinterface.sip
@@ -1,20 +1,28 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/raster/qgsrasterfilewriter.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/



/** Raster file writer */

/** \ingroup core
* The raster file writer which allows you to save a raster to a new file.
*/
class QgsRasterFileWriter
{
%Docstring
The raster file writer which allows you to save a raster to a new file.
%End

%TypeHeaderCode
#include <qgsrasterfilewriter.h>
#include <qgsrasterdataprovider.h>
#include "qgsrasterfilewriter.h"
%End
public:
enum Mode
{
Raw, // Raw data
Image, // Rendered image
Raw,
Image
};
enum WriterError
{
@@ -23,40 +31,49 @@ class QgsRasterFileWriter
DestProviderError,
CreateDatasourceError,
WriteError,
// Internal error if a value used for 'no data' was found in input
NoDataConflict,
WriteCanceled,
};

QgsRasterFileWriter( const QString& outputUrl );

/** Create a raster file with one band without initializing the pixel data.
* Returned provider may be used to initialize the raster using writeBlock() calls.
* Ownership of the returned provider is passed to the caller.
* @note Does not work with tiled mode enabled.
* @returns Instance of data provider in editing mode (on success) or null on error.
* @note added in QGIS 3.0
*/
QgsRasterDataProvider* createOneBandRaster( Qgis::DataType dataType,
int width, int height,
const QgsRectangle& extent,
const QgsCoordinateReferenceSystem& crs ) /Factory/;

/** Write raster file
@param pipe raster pipe
@param nCols number of output columns
@param nRows number of output rows (or -1 to automatically calculate row number to have square pixels)
@param outputExtent extent to output
@param crs crs to reproject to
@param p dialog to show progress in */
WriterError writeRaster( const QgsRasterPipe* pipe, int nCols, int nRows, const QgsRectangle& outputExtent,
const QgsCoordinateReferenceSystem& crs, QgsRasterBlockFeedback *feedback = nullptr );
QgsRasterFileWriter( const QString &outputUrl );

QgsRasterDataProvider *createOneBandRaster( Qgis::DataType dataType,
int width, int height,
const QgsRectangle &extent,
const QgsCoordinateReferenceSystem &crs ) /Factory/;
%Docstring
Create a raster file with one band without initializing the pixel data.
Returned provider may be used to initialize the raster using writeBlock() calls.
Ownership of the returned provider is passed to the caller.
.. note::

Does not work with tiled mode enabled.
\returns Instance of data provider in editing mode (on success) or null on error.
.. versionadded:: 3.0
%End

WriterError writeRaster( const QgsRasterPipe *pipe, int nCols, int nRows, const QgsRectangle &outputExtent,
const QgsCoordinateReferenceSystem &crs, QgsRasterBlockFeedback *feedback = 0 );
%Docstring
Write raster file
\param pipe raster pipe
\param nCols number of output columns
\param nRows number of output rows (or -1 to automatically calculate row number to have square pixels)
\param outputExtent extent to output
\param crs crs to reproject to
\param feedback optional feedback object for progress reports
%End

QString outputUrl() const;
%Docstring
Returns the output URL for the raster.
.. versionadded:: 3.0
%End

void setOutputFormat( const QString& format );
void setOutputFormat( const QString &format );
QString outputFormat() const;

void setOutputProviderKey( const QString& key );
void setOutputProviderKey( const QString &key );
QString outputProviderKey() const;

void setTiledMode( bool t );
@@ -69,22 +86,29 @@ class QgsRasterFileWriter
void setBuildPyramidsFlag( QgsRaster::RasterBuildPyramids f );

QList< int > pyramidsList() const;
void setPyramidsList( const QList< int > & list );

void setPyramidsList( const QList< int > &list );

QString pyramidsResampling() const;
void setPyramidsResampling( const QString & str );
void setPyramidsResampling( const QString &str );

QgsRaster::RasterPyramidsFormat pyramidsFormat() const;
void setPyramidsFormat( QgsRaster::RasterPyramidsFormat f );

void setMaxTileHeight( int h );
int maxTileHeight() const;

void setCreateOptions( const QStringList& list );
void setCreateOptions( const QStringList &list );
QStringList createOptions() const;

void setPyramidsConfigOptions( const QStringList& list );
void setPyramidsConfigOptions( const QStringList &list );
QStringList pyramidsConfigOptions() const;

};

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/raster/qgsrasterfilewriter.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
@@ -328,7 +328,7 @@ sub processDoxygenLine
}

# remove function bodies
if ( $line =~ m/^(\s*)?(const )?(virtual |static )?((\w+(<.*?>)?\s+(\*|&)?)?(\w+|operator.)\(.*?(\(.*\))*.*\)( (?:const|SIP_[A-Z_]*?))*)\s*(\{.*\})?(?!;)(\s*\/\/.*)?$/ ){
if ( $line =~ m/^(\s*)?(const )?(virtual |static )?(([\w:]+(<.*?>)?\s+(\*|&)?)?(\w+|operator.)\(.*?(\(.*\))*.*\)( (?:const|SIP_[A-Z_]*?))*)\s*(\{.*\})?(?!;)(\s*\/\/.*)?$/ ){
my $newline = "$1$2$3$4;\n";
if ($line !~ m/\{.*?\}$/){
$line = readline $header;
@@ -65,7 +65,7 @@ class CORE_EXPORT QgsRasterFileWriter
QgsRasterDataProvider *createOneBandRaster( Qgis::DataType dataType,
int width, int height,
const QgsRectangle &extent,
const QgsCoordinateReferenceSystem &crs );
const QgsCoordinateReferenceSystem &crs ) SIP_FACTORY;

/** Write raster file
\param pipe raster pipe
@@ -155,6 +155,11 @@ complex default value and type (i.e. containing commas) should be given as a str
void removeProxyFactory( QNetworkProxyFactory *factory /TransferBack/ );

bool removeFunctionBody( const QList<int, QString> &list, QgsVectorLayer *vl );
QgsRaster::RasterBuildPyramids buildPyramidsFlag() const;
%Docstring
Removing function body with namespaced return value
%End


virtual int overriddenProperty();
protected:
@@ -186,6 +186,9 @@ class CORE_EXPORT QgsSipifyHeader : public QtClass<QVariant>, private Ui::QgsBas

bool removeFunctionBody( const QList<int, QString> &list, QgsVectorLayer *vl ) { doSomething; return true; } // some comments

//! Removing function body with namespaced return value
QgsRaster::RasterBuildPyramids buildPyramidsFlag() const { return mBuildPyramidsFlag; }

bool deletedFunction() = delete; // some comments

virtual int overriddenProperty() override { return 42; } // if in doubt, comment it out

0 comments on commit 5ccc6cc

Please sign in to comment.