QgsRasterDataProvider Class Reference
[QGIS core library]

Base class for raster data providers. More...

#include <qgsrasterdataprovider.h>

Inheritance diagram for QgsRasterDataProvider:

Inheritance graph
[legend]
Collaboration diagram for QgsRasterDataProvider:

Collaboration graph
[legend]

List of all members.

Public Types

enum  Capability { NoCapabilities = 0, Identify = 1 }
 If you add to this, please also add to capabilitiesString(). More...

Public Member Functions

 QgsRasterDataProvider ()
 QgsRasterDataProvider (QString const &uri)
virtual ~QgsRasterDataProvider ()
virtual void addLayers (QStringList const &layers, QStringList const &styles=QStringList())=0
 Add the list of WMS layer names to be rendered by this server.
virtual QStringList supportedImageEncodings ()=0
 get raster image encodings supported by (e.g.) the WMS Server, expressed as MIME types
virtual QString imageEncoding () const =0
 Get the image encoding (as a MIME type) used in the transfer from (e.g.
virtual void setImageEncoding (QString const &mimeType)=0
 Set the image encoding (as a MIME type) used in the transfer from (e.g.
virtual void setImageCrs (QString const &crs)=0
 Set the image projection (in WMS CRS format) used in the transfer from (e.g.
virtual QImage * draw (QgsRectangle const &viewExtent, int pixelWidth, int pixelHeight)=0
 Renders the layer as an image.
virtual int capabilities () const
 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.
QString capabilitiesString () const
 Returns the above in friendly format.
virtual QString metadata ()=0
 Get metadata in a format suitable for feeding directly into a subset of the GUI raster properties "Metadata" tab.
virtual bool identify (const QgsPoint &point, QMap< QString, QString > &results)
 Identify raster value(s) found on the point position.
virtual QString identifyAsText (const QgsPoint &point)=0
 Identify details from a server (e.g.
virtual QString identifyAsHtml (const QgsPoint &point)=0
 Identify details from a server (e.g.
virtual QString lastErrorTitle ()=0
 Returns the caption error text for the last error in this provider.
virtual QString lastError ()=0
 Returns the verbose error text for the last error in this provider.
virtual QString lastErrorFormat ()
 Returns the format of the error text for the last error in this provider.
int dpi () const
 Returns the dpi of the output device.
void setDpi (int dpi)
 Sets the output device resolution.

Protected Attributes

int mDpi
 Dots per intch.


Detailed Description

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.

Definition at line 38 of file qgsrasterdataprovider.h.


Member Enumeration Documentation

If you add to this, please also add to capabilitiesString().

Enumerator:
NoCapabilities 
Identify 

Definition at line 46 of file qgsrasterdataprovider.h.


Constructor & Destructor Documentation

QgsRasterDataProvider::QgsRasterDataProvider (  ) 

Definition at line 24 of file qgsrasterdataprovider.cpp.

QgsRasterDataProvider::QgsRasterDataProvider ( QString const &  uri  ) 

Definition at line 28 of file qgsrasterdataprovider.cpp.

virtual QgsRasterDataProvider::~QgsRasterDataProvider (  )  [inline, virtual]

Definition at line 58 of file qgsrasterdataprovider.h.


Member Function Documentation

virtual void QgsRasterDataProvider::addLayers ( QStringList const &  layers,
QStringList const &  styles = QStringList() 
) [pure virtual]

Add the list of WMS layer names to be rendered by this server.

Referenced by QgsRasterLayer::setDataProvider().

virtual QStringList QgsRasterDataProvider::supportedImageEncodings (  )  [pure virtual]

get raster image encodings supported by (e.g.) the WMS Server, expressed as MIME types

virtual QString QgsRasterDataProvider::imageEncoding (  )  const [pure virtual]

Get the image encoding (as a MIME type) used in the transfer from (e.g.

) the WMS server

Referenced by QgsRasterLayer::writeSymbology().

virtual void QgsRasterDataProvider::setImageEncoding ( QString const &  mimeType  )  [pure virtual]

Set the image encoding (as a MIME type) used in the transfer from (e.g.

) the WMS server

Referenced by QgsRasterLayer::setDataProvider().

virtual void QgsRasterDataProvider::setImageCrs ( QString const &  crs  )  [pure virtual]

Set the image projection (in WMS CRS format) used in the transfer from (e.g.

) the WMS server

Referenced by QgsRasterLayer::setDataProvider().

virtual QImage* QgsRasterDataProvider::draw ( QgsRectangle const &  viewExtent,
int  pixelWidth,
int  pixelHeight 
) [pure virtual]

Renders the layer as an image.

Referenced by QgsRasterLayer::draw().

virtual int QgsRasterDataProvider::capabilities (  )  const [inline, virtual]

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.

Definition at line 96 of file qgsrasterdataprovider.h.

References NoCapabilities.

Referenced by capabilitiesString().

QString QgsRasterDataProvider::capabilitiesString (  )  const

Returns the above in friendly format.

Definition at line 34 of file qgsrasterdataprovider.cpp.

References capabilities(), Identify, and QgsDebugMsg.

virtual QString QgsRasterDataProvider::metadata (  )  [pure virtual]

Get metadata in a format suitable for feeding directly into a subset of the GUI raster properties "Metadata" tab.

Referenced by QgsRasterLayer::metadata().

bool QgsRasterDataProvider::identify ( const QgsPoint point,
QMap< QString, QString > &  results 
) [virtual]

Identify raster value(s) found on the point position.

Definition at line 49 of file qgsrasterdataprovider.cpp.

Referenced by QgsRasterLayer::identify().

virtual QString QgsRasterDataProvider::identifyAsText ( const QgsPoint point  )  [pure virtual]

Identify details from a server (e.g.

WMS) from the last screen update

Parameters:
[in] point The pixel coordinate (as it was displayed locally on screen)
Returns:
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.

The arbitraryness of the returned document is enforced by WMS standards up to at least v1.3.0

Referenced by QgsRasterLayer::identifyAsText().

virtual QString QgsRasterDataProvider::identifyAsHtml ( const QgsPoint point  )  [pure virtual]

Identify details from a server (e.g.

WMS) from the last screen update

Parameters:
[in] point The pixel coordinate (as it was displayed locally on screen)
Returns:
A html 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.

The arbitraryness of the returned document is enforced by WMS standards up to at least v1.3.0

added in 1.5

Referenced by QgsRasterLayer::identifyAsHtml().

virtual QString QgsRasterDataProvider::lastErrorTitle (  )  [pure virtual]

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.

Referenced by QgsRasterLayer::draw().

virtual QString QgsRasterDataProvider::lastError (  )  [pure virtual]

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.

Referenced by QgsRasterLayer::draw().

QString QgsRasterDataProvider::lastErrorFormat (  )  [virtual]

Returns the format of the error text for the last error in this provider.

Note:
added in 1.6

Definition at line 55 of file qgsrasterdataprovider.cpp.

int QgsRasterDataProvider::dpi (  )  const [inline]

Returns the dpi of the output device.

Note:
: this method was added in version 1.2

Definition at line 185 of file qgsrasterdataprovider.h.

void QgsRasterDataProvider::setDpi ( int  dpi  )  [inline]

Sets the output device resolution.

Note:
: this method was added in version 1.2

Definition at line 189 of file qgsrasterdataprovider.h.

Referenced by QgsRasterLayer::draw().


Member Data Documentation

int QgsRasterDataProvider::mDpi [protected]

Dots per intch.

Extended WMS (e.g. QGIS mapserver) support DPI dependent output and therefore are suited for printing. A value of -1 means it has not been set

Note:
: this member has been added in version 1.2

Definition at line 196 of file qgsrasterdataprovider.h.


The documentation for this class was generated from the following files:

Generated on Sat Feb 4 19:17:47 2012 for Quantum GIS API Documentation by  doxygen 1.5.6