2007-01-09 02:39:15 +00:00
|
|
|
|
|
|
|
/** Base class for raster data providers
|
|
|
|
*
|
|
|
|
* \note This class has been copied and pasted from
|
|
|
|
* QgsVectorDataProvider, and does not yet make
|
|
|
|
* sense for Raster layers.
|
|
|
|
*/
|
2010-08-03 21:24:22 +00:00
|
|
|
|
2007-01-09 02:39:15 +00:00
|
|
|
class QgsRasterDataProvider : QgsDataProvider
|
|
|
|
{
|
2010-08-03 22:32:56 +00:00
|
|
|
%TypeHeaderCode
|
2007-01-09 02:39:15 +00:00
|
|
|
#include <qgsrasterdataprovider.h>
|
2010-08-03 22:32:56 +00:00
|
|
|
%End
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2010-08-03 21:24:22 +00:00
|
|
|
public:
|
2007-01-09 02:39:15 +00:00
|
|
|
|
|
|
|
//! If you add to this, please also add to capabilitiesString()
|
|
|
|
enum Capability
|
|
|
|
{
|
|
|
|
NoCapabilities = 0,
|
|
|
|
Identify = 1
|
2008-08-27 12:57:47 +00:00
|
|
|
// Capability2 = 1 << 1, etc
|
2007-01-09 02:39:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
QgsRasterDataProvider();
|
|
|
|
|
|
|
|
QgsRasterDataProvider( const QString & uri );
|
|
|
|
|
|
|
|
virtual ~QgsRasterDataProvider();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add the list of WMS layer names to be rendered by this server
|
|
|
|
*/
|
2010-08-03 21:24:22 +00:00
|
|
|
virtual void addLayers( const QStringList & layers,
|
|
|
|
const QStringList & styles = QStringList() ) = 0;
|
2007-01-09 02:39:15 +00:00
|
|
|
|
|
|
|
//! get raster image encodings supported by (e.g.) the WMS Server, expressed as MIME types
|
|
|
|
virtual QStringList supportedImageEncodings() = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the image encoding (as a MIME type) used in the transfer from (e.g.) the WMS server
|
|
|
|
*/
|
|
|
|
virtual QString imageEncoding() const = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the image encoding (as a MIME type) used in the transfer from (e.g.) the WMS server
|
|
|
|
*/
|
2010-08-03 21:24:22 +00:00
|
|
|
virtual void setImageEncoding( const QString & mimeType ) = 0;
|
|
|
|
|
2007-01-09 02:39:15 +00:00
|
|
|
/**
|
|
|
|
* Set the image projection (in WMS CRS format) used in the transfer from (e.g.) the WMS server
|
|
|
|
*/
|
2010-08-03 21:24:22 +00:00
|
|
|
virtual void setImageCrs( const QString & crs ) = 0;
|
2007-01-09 02:39:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
// TODO: Document this better.
|
|
|
|
/** \brief Renders the layer as an image
|
|
|
|
*/
|
2010-08-03 21:24:22 +00:00
|
|
|
virtual QImage* draw( const QgsRectangle & viewExtent, int pixelWidth, int pixelHeight ) = 0;
|
2007-01-09 02:39:15 +00:00
|
|
|
|
|
|
|
/** Returns a bitmask containing the supported capabilities
|
|
|
|
Note, some capabilities may change depending on whether
|
|
|
|
a spatial filter is active on this provider, so it may
|
|
|
|
be prudent to check this value per intended operation.
|
|
|
|
*/
|
|
|
|
virtual int capabilities() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the above in friendly format.
|
|
|
|
*/
|
|
|
|
QString capabilitiesString() const;
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: Get the supported formats by this provider
|
2010-08-03 21:24:22 +00:00
|
|
|
|
2007-01-09 02:39:15 +00:00
|
|
|
// TODO: Get the file masks supported by this provider, suitable for feeding into the file open dialog box
|
2010-08-03 21:24:22 +00:00
|
|
|
|
2007-01-09 02:39:15 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get metadata in a format suitable for feeding directly
|
|
|
|
* into a subset of the GUI raster properties "Metadata" tab.
|
|
|
|
*/
|
2008-10-24 22:31:31 +00:00
|
|
|
virtual QString metadata() = 0;
|
2007-01-09 02:39:15 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Identify details from a server (e.g. WMS) from the last screen update
|
|
|
|
*
|
|
|
|
* \param point[in] The pixel coordinate (as it was displayed locally on screen)
|
|
|
|
*
|
|
|
|
* \return A text document containing the return from the WMS server
|
|
|
|
*
|
|
|
|
* \note WMS Servers prefer to receive coordinates in image space, therefore
|
|
|
|
* this function expects coordinates in that format.
|
|
|
|
*
|
|
|
|
* \note The arbitraryness of the returned document is enforced by WMS standards
|
|
|
|
* up to at least v1.3.0
|
|
|
|
*/
|
2010-08-03 21:24:22 +00:00
|
|
|
virtual QString identifyAsText( const QgsPoint& point ) = 0;
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2010-05-11 21:08:45 +00:00
|
|
|
/**
|
|
|
|
* \brief Identify details from a server (e.g. WMS) from the last screen update
|
|
|
|
*
|
|
|
|
* \param point[in] The pixel coordinate (as it was displayed locally on screen)
|
|
|
|
*
|
|
|
|
* \return A text document containing the return from the WMS server
|
|
|
|
*
|
|
|
|
* \note WMS Servers prefer to receive coordinates in image space, therefore
|
|
|
|
* this function expects coordinates in that format.
|
|
|
|
*
|
|
|
|
* \note The arbitraryness of the returned document is enforced by WMS standards
|
|
|
|
* up to at least v1.3.0
|
|
|
|
*
|
|
|
|
* \note added in 1.5
|
|
|
|
*/
|
2010-08-03 21:24:22 +00:00
|
|
|
virtual QString identifyAsHtml( const QgsPoint& point ) = 0;
|
2010-05-11 21:08:45 +00:00
|
|
|
|
2007-01-09 02:39:15 +00:00
|
|
|
/**
|
|
|
|
* \brief Returns the caption error text for the last error in this provider
|
|
|
|
*
|
|
|
|
* If an operation returns 0 (e.g. draw()), this function
|
|
|
|
* returns the text of the error associated with the failure.
|
|
|
|
* Interactive users of this provider can then, for example,
|
|
|
|
* call a QMessageBox to display the contents.
|
|
|
|
*
|
|
|
|
*/
|
2008-10-24 11:00:31 +00:00
|
|
|
virtual QString lastErrorTitle() = 0;
|
2007-01-09 02:39:15 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Returns the verbose error text for the last error in this provider
|
|
|
|
*
|
|
|
|
* If an operation returns 0 (e.g. draw()), this function
|
|
|
|
* returns the text of the error associated with the failure.
|
|
|
|
* Interactive users of this provider can then, for example,
|
|
|
|
* call a QMessageBox to display the contents.
|
|
|
|
*
|
|
|
|
*/
|
2008-10-24 11:00:31 +00:00
|
|
|
virtual QString lastError() = 0;
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2010-08-03 21:24:22 +00:00
|
|
|
/**
|
|
|
|
* \brief Returns the format of the error text for the last error in this provider
|
|
|
|
*
|
|
|
|
* \note added in 1.6
|
|
|
|
*/
|
|
|
|
virtual QString lastErrorFormat();
|
|
|
|
|
|
|
|
/**Returns the dpi of the output device.
|
2009-06-05 13:13:45 +00:00
|
|
|
@note: this method was added in version 1.2*/
|
|
|
|
int dpi();
|
|
|
|
|
|
|
|
/**Sets the output device resolution.
|
|
|
|
@note: this method was added in version 1.2*/
|
2010-08-03 21:24:22 +00:00
|
|
|
void setDpi( int dpi );
|
2012-04-13 18:52:32 +02:00
|
|
|
|
|
|
|
/** read block of data using give extent and size */
|
|
|
|
/*virtual void readBlock( int bandNo,
|
|
|
|
QgsRectangle const & viewExtent,
|
|
|
|
int width, int height,
|
|
|
|
QgsCoordinateReferenceSystem theSrcCRS,
|
|
|
|
QgsCoordinateReferenceSystem theDestCRS,
|
|
|
|
void *data ); */
|
|
|
|
|
2007-01-09 02:39:15 +00:00
|
|
|
};
|
|
|
|
|