-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
more raster Python bindings, raster write test in Python
- Loading branch information
Showing
15 changed files
with
432 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
/** Raster checker for tests in python */ | ||
|
||
class QgsRasterChecker | ||
{ | ||
%TypeHeaderCode | ||
#include <qgsrasterchecker.h> | ||
%End | ||
public: | ||
|
||
QgsRasterChecker(); | ||
|
||
~QgsRasterChecker(); | ||
|
||
QString report(); | ||
|
||
bool runTest( QString theVerifiedKey, QString theVerifiedUri, | ||
QString theExpectedKey, QString theExpectedUri ); | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
|
||
/** Raster file writer */ | ||
|
||
class QgsRasterFileWriter | ||
{ | ||
%TypeHeaderCode | ||
#include <qgsrasterfilewriter.h> | ||
#include <qgsrasterdataprovider.h> | ||
%End | ||
public: | ||
enum WriterError | ||
{ | ||
NoError = 0, | ||
SourceProviderError = 1, | ||
DestProviderError = 2, | ||
CreateDatasourceError = 3, | ||
WriteError = 4, | ||
NoDataConflict = 5 | ||
}; | ||
|
||
QgsRasterFileWriter( const QString& outputUrl ); | ||
~QgsRasterFileWriter(); | ||
WriterError writeRaster( const QgsRasterPipe* pipe, int nCols, int nRows, QgsRectangle outputExtent, | ||
const QgsCoordinateReferenceSystem& crs, QProgressDialog* p = 0 ); | ||
|
||
void setOutputFormat( const QString& format ); | ||
QString outputFormat() const; | ||
|
||
void setOutputProviderKey( const QString& key ); | ||
QString outputProviderKey() const; | ||
|
||
void setTiledMode( bool t ); | ||
bool tiledMode() const; | ||
|
||
void setMaxTileWidth( int w ); | ||
int maxTileWidth() const; | ||
|
||
QgsRasterDataProvider::RasterBuildPyramids buildPyramidsFlag() const; | ||
void setBuildPyramidsFlag( QgsRasterDataProvider::RasterBuildPyramids f ); | ||
|
||
QList< int > pyramidsList() const; | ||
void setPyramidsList( const QList< int > & list ); | ||
|
||
QString pyramidsResampling() const; | ||
void setPyramidsResampling( const QString & str ); | ||
|
||
QgsRasterDataProvider::RasterPyramidsFormat pyramidsFormat() const; | ||
void setPyramidsFormat( QgsRasterDataProvider::RasterPyramidsFormat f ); | ||
|
||
void setMaxTileHeight( int h ); | ||
int maxTileHeight() const; | ||
|
||
void setCreateOptions( const QStringList& list ); | ||
QStringList createOptions() const; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
|
||
/** Raster pipe */ | ||
|
||
class QgsRasterPipe | ||
{ | ||
%TypeHeaderCode | ||
#include <qgsrasterpipe.h> | ||
#include <qgsrasterresamplefilter.h> | ||
#include <qgsrasterprojector.h> | ||
%End | ||
public: | ||
enum Role | ||
{ | ||
UnknownRole = 0, | ||
ProviderRole = 1, | ||
RendererRole = 2, | ||
ResamplerRole = 3, | ||
ProjectorRole = 4 | ||
}; | ||
|
||
QgsRasterPipe(); | ||
QgsRasterPipe( const QgsRasterPipe& thePipe ); | ||
|
||
~QgsRasterPipe(); | ||
|
||
bool insert( int idx, QgsRasterInterface* theInterface ); | ||
|
||
bool replace( int idx, QgsRasterInterface* theInterface ); | ||
|
||
bool set( QgsRasterInterface * theInterface ); | ||
|
||
bool remove( int idx ); | ||
|
||
bool remove( QgsRasterInterface * theInterface ); | ||
|
||
int size() const; | ||
QgsRasterInterface * at( int idx ) const; | ||
QgsRasterInterface * last() const; | ||
|
||
bool setOn( int idx, bool on ); | ||
|
||
bool canSetOn( int idx, bool on ); | ||
|
||
QgsRasterDataProvider * provider() const; | ||
QgsRasterRenderer * renderer() const; | ||
QgsRasterResampleFilter * resampleFilter() const; | ||
QgsRasterProjector * projector() const; | ||
|
||
void setStatsOn( bool on ); | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
|
||
/** Raster projector */ | ||
|
||
class QgsRasterProjector | ||
{ | ||
%TypeHeaderCode | ||
#include <qgsrasterprojector.h> | ||
#include <qgscoordinatereferencesystem.h> | ||
%End | ||
public: | ||
QgsRasterProjector( | ||
QgsCoordinateReferenceSystem theSrcCRS, | ||
QgsCoordinateReferenceSystem theDestCRS, | ||
QgsRectangle theDestExtent, | ||
int theDestRows, int theDestCols, | ||
double theMaxSrcXRes, double theMaxSrcYRes, | ||
QgsRectangle theExtent | ||
); | ||
QgsRasterProjector( | ||
QgsCoordinateReferenceSystem theSrcCRS, | ||
QgsCoordinateReferenceSystem theDestCRS, | ||
double theMaxSrcXRes, double theMaxSrcYRes, | ||
QgsRectangle theExtent | ||
); | ||
QgsRasterProjector(); | ||
|
||
~QgsRasterProjector(); | ||
|
||
QgsRasterInterface * clone() const; | ||
|
||
int bandCount() const; | ||
|
||
QgsRasterInterface::DataType dataType( int bandNo ) const; | ||
|
||
void setCRS( const QgsCoordinateReferenceSystem & theSrcCRS, const QgsCoordinateReferenceSystem & theDestCRS ); | ||
|
||
QgsCoordinateReferenceSystem srcCrs() const; | ||
|
||
QgsCoordinateReferenceSystem destCrs() const; | ||
|
||
void setMaxSrcRes( double theMaxSrcXRes, double theMaxSrcYRes ); | ||
|
||
QgsRectangle srcExtent(); | ||
|
||
int srcRows(); | ||
int srcCols(); | ||
void setSrcRows( int theRows ); | ||
void setSrcCols( int theCols ); | ||
|
||
void srcRowCol( int theDestRow, int theDestCol, int *theSrcRow, int *theSrcCol ); | ||
|
||
int dstRows() const; | ||
int dstCols() const; | ||
|
||
void * readBlock( int bandNo, const QgsRectangle & extent, int width, int height ); | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,37 @@ | ||
|
||
/** Raster resample filter */ | ||
|
||
class QgsRasterResampleFilter | ||
{ | ||
%TypeHeaderCode | ||
#include "qgsrasterresamplefilter.h" | ||
#include <qgsrasterresamplefilter.h> | ||
%End | ||
QgsRasterResampleFilter(); | ||
QgsRasterResampleFilter( const QgsRasterResampleFilter& thePipe ); | ||
|
||
public: | ||
QgsRasterResampleFilter( QgsRasterFace* input = 0 ); | ||
~QgsRasterResampleFilter(); | ||
|
||
QgsRasterInterface * clone() const; | ||
|
||
int bandCount() const; | ||
|
||
QgsRasterInterface::DataType dataType( int bandNo ) const; | ||
|
||
bool setInput( QgsRasterInterface* input ); | ||
|
||
void * readBlock( int bandNo, const QgsRectangle & extent, int width, int height ); | ||
|
||
/**Set resampler for zoomed in scales. Takes ownership of the object*/ | ||
void setZoomedInResampler( QgsRasterResampler* r ); | ||
const QgsRasterResampler* zoomedInResampler(); | ||
const QgsRasterResampler* zoomedInResampler() const; | ||
|
||
/**Set resampler for zoomed out scales. Takes ownership of the object*/ | ||
void setZoomedOutResampler( QgsRasterResampler* r ); | ||
const QgsRasterResampler* zoomedOutResampler() const; | ||
|
||
void setMaxOversampling( double os ); | ||
double maxOversampling() const; | ||
|
||
virtual void writeXML( QDomDocument& doc, QDomElement& parentElem ) const = 0; | ||
void writeXML( QDomDocument& doc, QDomElement& parentElem ); | ||
|
||
/**Sets base class members from xml. Usually called from create() methods of subclasses*/ | ||
void readXML( const QDomElement& rendererElem ); | ||
void readXML( const QDomElement& resamplefilterElem ); | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.