Quantum GIS API Documentation
1.7.4
|
This class provides qgis with the ability to render raster datasets onto the mapcanvas. More...
#include <qgsrasterlayer.h>
Public Types | |
enum | ColorShadingAlgorithm { UndefinedShader, PseudoColorShader, FreakOutShader, ColorRampShader, UserDefinedShader } |
This enumerator describes the types of shading that can be used. More... | |
enum | DrawingStyle { UndefinedDrawingStyle, SingleBandGray, SingleBandPseudoColor, PalettedColor, PalettedSingleBandGray, PalettedSingleBandPseudoColor, PalettedMultiBandColor, MultiBandSingleGandGray, MultiBandSingleBandGray = MultiBandSingleGandGray, MultiBandSingleBandPseudoColor, MultiBandColor, SingleBandColorDataStyle } |
This enumerator describes the different kinds of drawing we can do. More... | |
enum | LayerType { GrayOrUndefined, Palette, Multiband, ColorLayer } |
This enumerator describes the type of raster layer. More... | |
typedef QList < QgsContrastEnhancement > | ContrastEnhancementList |
A list containing on ContrastEnhancement object per raster band in this raster layer. | |
typedef QList< QgsRasterPyramid > | RasterPyramidList |
A list containing one RasterPyramid struct per raster band in this raster layer. | |
typedef QList< QgsRasterBandStats > | RasterStatsList |
A list containing one RasterBandStats struct per raster band in this raster layer. | |
Public Slots | |
QString | buildPyramids (const RasterPyramidList &, const QString &theResamplingMethod="NEAREST", bool theTryInternalFlag=false) |
Create GDAL pyramid overviews. | |
void | populateHistogram (int theBandNoInt, int theBinCountInt=256, bool theIgnoreOutOfRangeFlag=true, bool theThoroughBandScanFlag=false) |
Populate the histogram vector for a given band. | |
void | showStatusMessage (const QString &theMessage) |
void | updateProgress (int, int) |
Propagate progress updates from GDAL up to the parent app. | |
void | onProgress (int, double, QString) |
recieve progress signal from provider | |
Signals | |
void | progressUpdate (int theValue) |
Signal for notifying listeners of long running processes. | |
void | dataChanged () |
This is emitted whenever data or metadata (e.g. | |
Public Member Functions | |
QgsRasterLayer (const QString &path=QString::null, const QString &baseName=QString::null, bool loadDefaultStyleFlag=true) | |
This is the constructor for the RasterLayer class. | |
QgsRasterLayer (int dummy, const QString &baseName=QString(), const QString &path=QString(), const QString &providerLib=QString(), const QStringList &layers=QStringList(), const QStringList &styles=QStringList(), const QString &format=QString(), const QString &crs=QString()) | |
[ data provider interface ] Constructor in provider mode | |
~QgsRasterLayer () | |
The destructor. | |
void | init () |
Initialize default values. | |
void | setDataProvider (const QString &provider, const QStringList &layers, const QStringList &styles, const QString &format, const QString &crs) |
void | setDataProvider (const QString &provider, const QStringList &layers, const QStringList &styles, const QString &format, const QString &crs, bool loadDefaultStyleFlag) |
[ data provider interface ] Set the data provider | |
QString | blueBandName () const |
Accessor for blue band name mapping. | |
QgsRasterLayer::ColorShadingAlgorithm | colorShadingAlgorithm () const |
Accessor for color shader algorithm. | |
QgsContrastEnhancement::ContrastEnhancementAlgorithm | contrastEnhancementAlgorithm () |
Accessor for contrast enhancement algorithm. | |
QString | contrastEnhancementAlgorithmAsString () const |
Returns contrast enhancement algorithm as a string. | |
DrawingStyle | drawingStyle () |
Accessor for drawing style. | |
QString | grayBandName () const |
Accessor for gray band name mapping. | |
QString | greenBandName () const |
Accessor for green band name mapping. | |
bool | hasPyramids () |
Accessor for mHasPyramids (READ ONLY) | |
bool | hasUserDefinedGrayMinimumMaximum () const |
Accessor for mUserDefinedGrayMinimumMaximum. | |
bool | hasUserDefinedRGBMinimumMaximum () const |
Accessor for mUserDefinedRGBMinimumMaximum. | |
int | height () |
Accessor that returns the height of the (unclipped) raster. | |
bool | invertHistogram () const |
Accessor to find out whether the histogram should be inverted. | |
bool | isNoDataValueValid () const |
Is the NoDataValue Valid. | |
bool | isGrayMinimumMaximumEstimated () const |
Accessor for mGrayMinimumMaximumEstimated. | |
bool | isRGBMinimumMaximumEstimated () const |
Accessor for mRGBMinimumMaximumEstimated. | |
double | noDataValue (bool *isValid=0) |
Accessor that returns the NO_DATA entry for this raster. | |
QgsRasterTransparency * | rasterTransparency () |
Returns a pointer to the transparency object. | |
QgsRasterShader * | rasterShader () |
Accessor for raster shader. | |
LayerType | rasterType () |
Accessor for raster layer type (which is a read only property) | |
QString | redBandName () const |
Accessor for red band name (allows alternate mappings e.g. | |
void | setDrawingStyle (const DrawingStyle &theDrawingStyle) |
Mutator for drawing style. | |
void | setGrayMinimumMaximumEstimated (bool theBool) |
Mutator for mGrayMinimumMaximumEstimated. | |
void | setInvertHistogram (bool theFlag) |
Mutator to alter the state of the invert histogram flag. | |
void | setRGBMinimumMaximumEstimated (bool theBool) |
Mutator for mRGBMinimumMaximumEstimated. | |
void | setStandardDeviations (double theStandardDeviations) |
Mutator to alter the number of standard deviations that should be plotted. | |
void | setUserDefinedGrayMinimumMaximum (bool theBool) |
Mutator for mUserDefinedGrayMinimumMaximum. | |
void | setUserDefinedRGBMinimumMaximum (bool theBool) |
Mutator for mUserDefinedRGBMinimumMaximum. | |
double | standardDeviations () const |
Accessor to find out how many standard deviations are being plotted. | |
QString | transparentBandName () const |
Accessor for transparent band name mapping. | |
bool | usesProvider () |
[ data provider interface ] Does this layer use a provider for setting/retrieving data? | |
int | width () |
Accessor that returns the width of the (unclipped) raster. | |
unsigned int | bandCount () |
Get the number of bands in this layer. | |
const QString | bandName (int theBandNoInt) |
Get the name of a band given its number. | |
int | bandNumber (const QString &theBandName) |
Get the number of a band given its name. | |
const QgsRasterBandStats | bandStatistics (int) |
Get RasterBandStats for a band given its number (read only) | |
const QgsRasterBandStats | bandStatistics (const QString &) |
Get RasterBandStats for a band given its name (read only) | |
RasterPyramidList | buildPyramidList () |
Accessor for ths raster layers pyramid list. | |
QString | colorShadingAlgorithmAsString () const |
Accessor for color shader algorithm. | |
void | computeMinimumMaximumEstimates (int theBand, double *theMinMax) |
Wrapper for GDALComputeRasterMinMax with the estimate option. | |
void | computeMinimumMaximumEstimates (QString theBand, double *theMinMax) |
Wrapper for GDALComputeRasterMinMax with the estimate option. | |
void | computeMinimumMaximumEstimates (int theBand, double &theMin, double &theMax) |
Wrapper for GDALComputeRasterMinMax with the estimate option. | |
void | computeMinimumMaximumFromLastExtent (int theBand, double *theMinMax) |
Compute the actual minimum maximum pixel values based on the current (last) display extent. | |
void | computeMinimumMaximumFromLastExtent (QString theBand, double *theMinMax) |
Compute the actual minimum maximum pixel values based on the current (last) display extent. | |
void | computeMinimumMaximumFromLastExtent (int theBand, double &theMin, double &theMax) |
Compute the actual minimum maximum pixel values based on the current (last) display extent. | |
QgsContrastEnhancement * | contrastEnhancement (unsigned int theBand) |
Get a pointer to the contrast enhancement for the selected band. | |
bool | copySymbologySettings (const QgsMapLayer &theOther) |
Copies the symbology settings from another layer. | |
QList < QgsColorRampShader::ColorRampItem > * | colorTable (int theBandNoInt) |
Get a pointer to the color table. | |
QgsRasterDataProvider * | dataProvider () |
Returns the data provider. | |
const QgsRasterDataProvider * | dataProvider () const |
Returns the data provider in a const-correct manner. | |
virtual void | reload () |
Synchronises with changes in the datasource. | |
bool | draw (QgsRenderContext &rendererContext) |
This is called when the view on the raster layer needs to be redrawn. | |
void | draw (QPainter *theQPainter, QgsRasterViewPort *myRasterViewPort, const QgsMapToPixel *theQgsMapToPixel=0) |
This is an overloaded version of the draw() function that is called by both draw() and thumbnailAsPixmap. | |
QString | drawingStyleAsString () const |
Returns a string representation of drawing style. | |
bool | hasCompatibleSymbology (const QgsMapLayer &theOther) const |
Checks if symbology is the same as another layers. | |
bool | hasStatistics (int theBandNoInt) |
Check whether a given band number has stats associated with it. | |
bool | identify (const QgsPoint &point, QMap< QString, QString > &results) |
Identify raster value(s) found on the point position. | |
QString | identifyAsText (const QgsPoint &point) |
Identify arbitrary details from the WMS server found on the point position. | |
QString | identifyAsHtml (const QgsPoint &point) |
Identify arbitrary details from the WMS server found on the point position. | |
bool | isEditable () const |
Currently returns always false. | |
QString | lastError () |
[ data provider interface ] If an operation returns 0 (e.g. | |
QString | lastErrorTitle () |
[ data provider interface ] If an operation returns 0 (e.g. | |
QPixmap | legendAsPixmap () |
Get a legend image for this layer. | |
QPixmap | legendAsPixmap (bool) |
Overloaded version of above function that can print layer name onto legend. | |
QPixmap | legendAsPixmap (int theLabelCount) |
Use this method when you want an annotated legend suitable for print output etc. | |
double | maximumValue (unsigned int theBand) |
Accessor for maximum value user for contrast enhancement. | |
double | maximumValue (QString theBand) |
Accessor for maximum value user for contrast enhancement. | |
QString | metadata () |
Obtain GDAL Metadata for this layer. | |
double | minimumValue (unsigned int theBand) |
Accessor for minimum value user for contrast enhancement. | |
double | minimumValue (QString theBand) |
Accessor for minimum value user for contrast enhancement. | |
QPixmap | paletteAsPixmap (int theBand=1) |
Get an 100x100 pixmap of the color palette. | |
QString | providerKey () const |
[ data provider interface ] Which provider is being used for this Raster Layer? | |
double | rasterUnitsPerPixel () |
Returns the number of raster units per each raster pixel. | |
bool | readColorTable (int theBandNumber, QList< QgsColorRampShader::ColorRampItem > *theList) |
Read color table from GDAL raster band. | |
void | resetNoDataValue () |
Simple reset function that set the noDataValue back to the value stored in the first raster band. | |
void | setBlueBandName (const QString &theBandName) |
Mutator for blue band name mapping. | |
void | setColorShadingAlgorithm (QgsRasterLayer::ColorShadingAlgorithm theShaderAlgorithm) |
Mutator for color shader algorithm. | |
void | setColorShadingAlgorithm (QString theShaderAlgorithm) |
Mutator for color shader algorithm. | |
void | setContrastEnhancementAlgorithm (QgsContrastEnhancement::ContrastEnhancementAlgorithm theAlgorithm, bool theGenerateLookupTableFlag=true) |
Mutator for contrast enhancement algorithm. | |
void | setContrastEnhancementAlgorithm (QString theAlgorithm, bool theGenerateLookupTableFlag=true) |
Mutator for contrast enhancement algorithm. | |
void | setContrastEnhancementFunction (QgsContrastEnhancementFunction *theFunction) |
Mutator for contrast enhancement function. | |
void | setDrawingStyle (const QString &theDrawingStyleQString) |
Overloaded version of the above function for convenience when restoring from xml. | |
void | setGrayBandName (const QString &theBandName) |
Mutator for gray band name mapping. | |
void | setGreenBandName (const QString &theBandName) |
Mutator for green band name mapping. | |
void | setMaximumValue (unsigned int theBand, double theValue, bool theGenerateLookupTableFlag=true) |
Mutator for setting the maximum value for contrast enhancement. | |
void | setMaximumValue (QString theBand, double theValue, bool theGenerateLookupTableFlag=true) |
Mutator for setting the maximum value for contrast enhancement. | |
void | setMinimumMaximumUsingLastExtent () |
Sets the minimum and maximum values for the band(s) currently being displayed using the only pixel values from the last/current extent. | |
void | setMinimumMaximumUsingDataset () |
Sets the minimum and maximum values for the band(s) currently being displayed using the only pixel values from the dataset min/max. | |
void | setMinimumValue (unsigned int theBand, double theValue, bool theGenerateLookupTableFlag=true) |
Mutator for setting the minimum value for contrast enhancement. | |
void | setMinimumValue (QString theBand, double theValue, bool theGenerateLookupTableFlag=true) |
Mutator for setting the minimum value for contrast enhancement. | |
void | setNoDataValue (double theNoData) |
Mutator that allows the NO_DATA entry for this raster to be overridden. | |
void | setRasterShaderFunction (QgsRasterShaderFunction *theFunction) |
Set the raster shader function to a user defined function. | |
void | setRedBandName (const QString &theBandName) |
Mutator for red band name (allows alternate mappings e.g. | |
void | setTransparentBandName (const QString &theBandName) |
Mutator for transparent band name mapping. | |
void | showProgress (int theValue) |
[ data provider interface ] A wrapper function to emit a progress update signal | |
QStringList | subLayers () const |
Returns the sublayers of this layer - Useful for providers that manage their own layers, such as WMS. | |
void | thumbnailAsPixmap (QPixmap *theQPixmap) |
Draws a thumbnail of the rasterlayer into the supplied pixmap pointer. | |
void | thumbnailAsImage (QImage *thepImage) |
Draws a thumbnail of the rasterlayer into the supplied QImage pointer. | |
void | triggerRepaint () |
Emit a signal asking for a repaint. | |
virtual void | setLayerOrder (const QStringList &layers) |
Reorders the *previously selected* sublayers of this layer from bottom to top. | |
virtual void | setSubLayerVisibility (const QString &name, bool vis) |
Set the visibility of the given sublayer name. | |
virtual QDateTime | timestamp () const |
Time stamp of data source in the moment when data/metadata were loaded by provider. | |
Static Public Member Functions | |
static void | buildSupportedRasterFileFilter (QString &fileFilters) |
Builds the list of file filter strings to later be used by QgisApp::addRasterLayer() We query GDAL for a list of supported raster formats; we then build a list of file filter strings from that list. | |
static bool | isValidRasterFileName (const QString &theFileNameQString, QString &retError) |
This helper checks to see whether the file name appears to be a valid raster file name. | |
static bool | isValidRasterFileName (const QString &theFileNameQString) |
static QDateTime | lastModified (const QString &name) |
Return time stamp for given file name. | |
static void | registerGdalDrivers () |
ensures that GDAL drivers are registered, but only once | |
static QLibrary * | loadProviderLibrary (QString theProviderKey) |
static QgsRasterDataProvider * | loadProvider (QString theProviderKey, QString theDataSource=0) |
Protected Member Functions | |
bool | readSymbology (const QDomNode &node, QString &errorMessage) |
Read the symbology for the current layer from the Dom node supplied. | |
bool | readXml (QDomNode &layer_node) |
Reads layer specific state from project file Dom node. | |
bool | writeSymbology (QDomNode &, QDomDocument &doc, QString &errorMessage) const |
Write the symbology for the layer into the docment provided. | |
bool | writeXml (QDomNode &layer_node, QDomDocument &doc) |
Write layer specific state to project file Dom node. | |
Private Member Functions | |
void | drawSingleBandColorData (QPainter *theQPainter, QgsRasterViewPort *theRasterViewPort, const QgsMapToPixel *theQgsMapToPixel, int theBandNoInt) |
Drawing routine for color type data. | |
void | drawMultiBandColor (QPainter *theQPainter, QgsRasterViewPort *theRasterViewPort, const QgsMapToPixel *theQgsMapToPixel) |
Drawing routine for multiband image. | |
void | drawMultiBandSingleBandGray (QPainter *theQPainter, QgsRasterViewPort *theRasterViewPort, const QgsMapToPixel *theQgsMapToPixel, int theBandNoInt) |
Drawing routine for multiband image, rendered as a single band image in grayscale. | |
void | drawMultiBandSingleBandPseudoColor (QPainter *theQPainter, QgsRasterViewPort *theRasterViewPort, const QgsMapToPixel *theQgsMapToPixel, int theBandNoInt) |
Drawing routine for multiband image, rendered as a single band image in pseudocolor. | |
void | drawPalettedSingleBandColor (QPainter *theQPainter, QgsRasterViewPort *theRasterViewPort, const QgsMapToPixel *theQgsMapToPixel, int theBandNoInt) |
Drawing routine for single band with a color map. | |
void | drawPalettedSingleBandGray (QPainter *theQPainter, QgsRasterViewPort *theRasterViewPort, const QgsMapToPixel *theQgsMapToPixel, int theBandNoInt) |
Drawing routine for paletted image, rendered as a single band image in grayscale. | |
void | drawPalettedSingleBandPseudoColor (QPainter *theQPainter, QgsRasterViewPort *theRasterViewPort, const QgsMapToPixel *theQgsMapToPixel, int theBandNoInt) |
Drawing routine for paletted image, rendered as a single band image in pseudocolor. | |
void | drawPalettedMultiBandColor (QPainter *theQPainter, QgsRasterViewPort *theRasterViewPort, const QgsMapToPixel *theQgsMapToPixel, int theBandNoInt) |
Drawing routine for paletted multiband image. | |
void | drawSingleBandGray (QPainter *theQPainter, QgsRasterViewPort *theRasterViewPort, const QgsMapToPixel *theQgsMapToPixel, int theBandNoInt) |
Drawing routine for single band grayscale image. | |
void | drawSingleBandPseudoColor (QPainter *theQPainter, QgsRasterViewPort *theRasterViewPort, const QgsMapToPixel *theQgsMapToPixel, int theBandNoInt) |
Drawing routine for single band grayscale image, rendered in pseudocolor. | |
void | closeDataProvider () |
Close data provider and clear related members. | |
QString | generateBandName (int) |
helper function to create zero padded band names | |
bool | hasBand (const QString &theBandName) |
Find out whether a given band exists. | |
QString | projectionWkt () |
Query GDAL to find out the Wkt projection string for this layer. | |
void * | readData (int bandNo, QgsRasterViewPort *viewPort) |
Allocate memory and load data to that allocated memory. | |
bool | readFile (const QString &fileName) |
Load the given raster file. | |
double | readValue (void *data, int type, int index) |
Read a raster value given position from memory block created by readData() | |
bool | update () |
Update the layer if it is outdated. | |
QString | validateBandName (const QString &theBandName) |
Verify and transform band name for internal consistency. | |
Private Attributes | |
const QString | QSTRING_NOT_SET |
Constant defining flag for XML and a constant that signals property not used. | |
const QString | TRSTRING_NOT_SET |
int | mBandCount |
The number of bands in the dataset. | |
QString | mBlueBandName |
The band to be associated with the color blue - usually 3. | |
ColorShadingAlgorithm | mColorShadingAlgorithm |
The raster shading algorithm being used. | |
QgsContrastEnhancement::ContrastEnhancementAlgorithm | mContrastEnhancementAlgorithm |
The contrast enhancement algorithm being used. | |
ContrastEnhancementList | mContrastEnhancementList |
List containing the contrast enhancements for each band. | |
double | mStandardDeviations |
Number of stddev to plot (0) to ignore. | |
QgsRasterDataProvider * | mDataProvider |
[ data provider interface ] Pointer to data provider derived from the abstract base class QgsDataProvider | |
DrawingStyle | mDrawingStyle |
bool | mEditable |
[ data provider interface ] Flag indicating whether the layer is in editing mode or not | |
QString | mError |
[ data provider interface ]The error message associated with the last error | |
QString | mErrorCaption |
[ data provider interface ] The error caption associated with the last error | |
double | mGeoTransform [6] |
Pointer to the gdaldataset. | |
QString | mGrayBandName |
The band to be associated with the grayscale only output - usually 1. | |
bool | mGrayMinimumMaximumEstimated |
Flag to indicate of the min max values are actual or estimates/user defined. | |
QString | mGreenBandName |
The band to be associated with the color green - usually 2. | |
bool | mHasPyramids |
Whether this raster has overviews / pyramids or not. | |
int | mWidth |
Raster width. | |
int | mHeight |
Raster height. | |
bool | mInvertColor |
Flag indicating whether the color of pixels should be inverted or not. | |
QDateTime | mLastModified |
[ data provider interface ] Timestamp, the last modified time of the data source when the layer was created | |
QgsRasterViewPort | mLastViewPort |
bool | mModified |
[ data provider interface ] pointer for loading the provider library | |
double | mNoDataValue |
Cell value representing no data. | |
QString | mProviderKey |
[ data provider interface ] Data provider key | |
RasterPyramidList | mPyramidList |
This list holds a series of RasterPyramid structs which store information for each potential pyramid level. | |
QgsRasterShader * | mRasterShader |
The raster shader for the layer. | |
RasterStatsList | mRasterStatsList |
A collection of stats - one for each band in the layer. | |
QgsRasterTransparency | mRasterTransparency |
The transparency container. | |
LayerType | mRasterType |
QString | mRedBandName |
The band to be associated with the color red - usually 1. | |
bool | mRGBMinimumMaximumEstimated |
Flag to indicate of the min max values are actual or estimates/user defined. | |
QString | mTransparencyBandName |
The band to be associated with transparency. | |
bool | mUserDefinedGrayMinimumMaximum |
Flag to indicate if the user entered custom min max values. | |
bool | mUserDefinedRGBMinimumMaximum |
Flag to indicate if the user entered custom min max values. | |
bool | mValidNoDataValue |
Flag indicating if the nodatavalue is valid. | |
QStringList | mLayers |
WMS parameters. | |
QStringList | mStyles |
QString | mFormat |
QString | mCrs |
This class provides qgis with the ability to render raster datasets onto the mapcanvas.
The qgsrasterlayer class makes use of gdal for data io, and thus supports any gdal supported format. The constructor attempts to infer what type of file (LayerType) is being opened - not in terms of the file format (tif, ascii grid etc.) but rather in terms of whether the image is a GRAYSCALE, PaletteD or Multiband,
Within the three allowable raster layer types, there are 8 permutations of how a layer can actually be rendered. These are defined in the DrawingStyle enum and consist of:
SingleBandGray -> a GRAYSCALE layer drawn as a range of gray colors (0-255) SingleBandPseudoColor -> a GRAYSCALE layer drawn using a pseudocolor algorithm PalettedSingleBandGray -> a PaletteD layer drawn in gray scale (using only one of the color components) PalettedSingleBandPseudoColor -> a PaletteD layer having only one of its color components rendered as psuedo color PalettedMultiBandColor -> a PaletteD image where the bands contains 24bit color info and 8 bits is pulled out per color MultiBandSingleBandGray -> a layer containing 2 or more bands, but using only one band to produce a grayscale image MultiBandSingleBandPseudoColor -> a layer containing 2 or more bands, but using only one band to produce a pseudocolor image MultiBandColor -> a layer containing 2 or more bands, mapped to the three RGBcolors. In the case of a multiband with only two bands, one band will have to be mapped to more than one color
Each of the above mentioned drawing styles is implemented in its own draw* function. Some of the drawing styles listed above require statistics about the layer such as the min / max / mean / stddev etc. statistics for a band can be gathered using the bandStatistics function. Note that statistics gathering is a slow process and every effort should be made to call this function as few times as possible. For this reason, qgsraster has a vector class member to store stats for each band. The constructor initialises this vector on startup, but only populates the band name and number fields.
Note that where bands are of gdal 'undefined' type, their values may exceed the renderable range of 0-255. Because of this a linear scaling histogram enhanceContrast is applied to undefined layers to normalise the data into the 0-255 range.
A qgsrasterlayer band can be referred to either by name or by number (base=1). It should be noted that band names as stored in datafiles may not be unique, and so the rasterlayer class appends the band number in brackets behind each band name.
Sample usage of the QgsRasterLayer class:
QString myFileNameQString = "/path/to/file"; QFileInfo myFileInfo(myFileNameQString); QString myBaseNameQString = myFileInfo.baseName(); QgsRasterLayer *myRasterLayer = new QgsRasterLayer(myFileNameQString, myBaseNameQString);
In order to automate redrawing of a raster layer, you should like it to a map canvas like this :
QObject::connect( myRasterLayer, SIGNAL(repaintRequested()), mapCanvas, SLOT(refresh()) );
A raster layer can also export its legend as a pixmap:
QPixmap myQPixmap = myRasterLayer->legendPixmap();
Once a layer has been created you can find out what type of layer it is (GrayOrUndefined, Palette or Multiband):
if (rasterLayer->rasterType()==QgsRasterLayer::Multiband) { //do something } else if (rasterLayer->rasterType()==QgsRasterLayer::Palette) { //do something } else // QgsRasterLayer::GrayOrUndefined { //do something. }
You can combine layer type detection with the setDrawingStyle method to override the default drawing style assigned when a layer is loaded:
if (rasterLayer->rasterType()==QgsRasterLayer::Multiband) { myRasterLayer->setDrawingStyle(QgsRasterLayer::MultiBandSingleBandPseudoColor); } else if (rasterLayer->rasterType()==QgsRasterLayer::Palette) { myRasterLayer->setDrawingStyle(QgsRasterLayer::PalettedSingleBandPseudoColor); } else // QgsRasterLayer::GrayOrUndefined { myRasterLayer->setDrawingStyle(QgsRasterLayer::SingleBandPseudoColor); }
Raster layers can also have an arbitrary level of transparency defined, and have their color palettes inverted using the setTransparency and setInvertHistogram methods.
Pseudocolor images can have their output adjusted to a given number of standard deviations using the setStandardDeviations method.
The final area of functionality you may be interested in is band mapping. Band mapping allows you to choose arbitrary band -> color mappings and is applicable only to Palette and Multiband rasters, There are four mappings that can be made: red, green, blue and gray. Mappings are non-exclusive. That is a given band can be assigned to no, some or all color mappings. The constructor sets sensible defaults for band mappings but these can be overridden at run time using the setRedBandName, setGreenBandName, setBlueBandName and setGrayBandName methods.
Definition at line 169 of file qgsrasterlayer.h.
typedef QList<QgsContrastEnhancement> QgsRasterLayer::ContrastEnhancementList |
A list containing on ContrastEnhancement object per raster band in this raster layer.
Definition at line 249 of file qgsrasterlayer.h.
typedef QList<QgsRasterPyramid> QgsRasterLayer::RasterPyramidList |
A list containing one RasterPyramid struct per raster band in this raster layer.
POTENTIAL pyramid layer. This works by dividing the height and width of the raster by an incrementing number. As soon as the result of the division is <=256 we stop allowing RasterPyramid structs to be added to the list. Each time a RasterPyramid is created we will check to see if a pyramid matching these dimensions already exists in the raster layer, and if so mark the exists flag as true
Definition at line 258 of file qgsrasterlayer.h.
typedef QList<QgsRasterBandStats> QgsRasterLayer::RasterStatsList |
A list containing one RasterBandStats struct per raster band in this raster layer.
Note that while every RasterBandStats element will have the name and number of its associated band populated, any additional stats are calculated on a need to know basis.
Definition at line 263 of file qgsrasterlayer.h.
This enumerator describes the types of shading that can be used.
Definition at line 212 of file qgsrasterlayer.h.
This enumerator describes the different kinds of drawing we can do.
Definition at line 222 of file qgsrasterlayer.h.
This enumerator describes the type of raster layer.
Reimplemented from QgsMapLayer.
Definition at line 240 of file qgsrasterlayer.h.
QgsRasterLayer::QgsRasterLayer | ( | const QString & | path = QString::null , |
const QString & | baseName = QString::null , |
||
bool | loadDefaultStyleFlag = true |
||
) |
This is the constructor for the RasterLayer class.
The main tasks carried out by the constructor are:
-Load the rasters default style (.qml) file if it exists
-Populate the RasterStatsVector with initial values for each band.
-Calculate the layer extents
-Determine whether the layer is gray, paletted or multiband.
-Assign sensible defaults for the red, green, blue and gray bands.
Definition at line 84 of file qgsrasterlayer.cpp.
References init(), QgsMapLayer::loadDefaultStyle(), QgsMapLayer::mValid, QgsDebugMsg, and setDataProvider().
QgsRasterLayer::QgsRasterLayer | ( | int | dummy, |
const QString & | baseName = QString() , |
||
const QString & | path = QString() , |
||
const QString & | providerLib = QString() , |
||
const QStringList & | layers = QStringList() , |
||
const QStringList & | styles = QStringList() , |
||
const QString & | format = QString() , |
||
const QString & | crs = QString() |
||
) |
[ data provider interface ] Constructor in provider mode
Definition at line 124 of file qgsrasterlayer.cpp.
References QgsMapLayer::crs(), init(), QgsDebugMsg, setDataProvider(), and QgsMapLayer::statusChanged().
The destructor.
Definition at line 175 of file qgsrasterlayer.cpp.
References mDataProvider, mRasterShader, and QgsMapLayer::mValid.
unsigned int QgsRasterLayer::bandCount | ( | ) |
Get the number of bands in this layer.
Definition at line 271 of file qgsrasterlayer.cpp.
References mBandCount.
Referenced by computeMinimumMaximumEstimates(), computeMinimumMaximumFromLastExtent(), contrastEnhancement(), maximumValue(), metadata(), minimumValue(), setMaximumValue(), and setMinimumValue().
const QString QgsRasterLayer::bandName | ( | int | theBandNoInt | ) |
Get the name of a band given its number.
Definition at line 276 of file qgsrasterlayer.cpp.
References mRasterStatsList.
Referenced by metadata(), readXml(), setDataProvider(), and validateBandName().
int QgsRasterLayer::bandNumber | ( | const QString & | theBandName | ) |
Get the number of a band given its name.
The name is the rewritten name set up in the constructor, and will not necessarily be the same as the name retrieved directly from gdal! If no matching band is found zero will be returned!
Definition at line 289 of file qgsrasterlayer.cpp.
References QgsRasterBandStats::bandName, QgsRasterBandStats::bandNumber, mRasterStatsList, and QgsDebugMsg.
Referenced by computeMinimumMaximumEstimates(), computeMinimumMaximumFromLastExtent(), draw(), drawMultiBandColor(), drawPalettedSingleBandColor(), drawPalettedSingleBandGray(), drawPalettedSingleBandPseudoColor(), drawSingleBandGray(), drawSingleBandPseudoColor(), maximumValue(), minimumValue(), setMaximumValue(), setMinimumMaximumUsingDataset(), and setMinimumValue().
const QgsRasterBandStats QgsRasterLayer::bandStatistics | ( | int | theBandNo | ) |
Get RasterBandStats for a band given its number (read only)
Private method to calculate statistics for a band.
Populates rasterStatsMemArray. Calculates:
Definition at line 330 of file qgsrasterlayer.cpp.
References QgsRasterDataProvider::bandCount(), QgsRasterBandStats::bandNumber, QgsRasterDataProvider::bandStatistics(), ColorLayer, QgsMapLayer::drawingProgress(), mDataProvider, mHeight, mRasterStatsList, mRasterType, Palette, QgsDebugMsg, and QgsRasterBandStats::statsGathered.
Referenced by bandStatistics(), drawMultiBandColor(), drawPalettedSingleBandPseudoColor(), drawSingleBandGray(), drawSingleBandPseudoColor(), metadata(), populateHistogram(), and setMinimumMaximumUsingDataset().
const QgsRasterBandStats QgsRasterLayer::bandStatistics | ( | const QString & | theBandName | ) |
Get RasterBandStats for a band given its name (read only)
Definition at line 379 of file qgsrasterlayer.cpp.
References QgsRasterDataProvider::bandCount(), QgsRasterBandStats::bandName, bandStatistics(), QgsMapLayer::drawingProgress(), mDataProvider, QgsMapLayer::name(), and QgsMapLayer::statusChanged().
QString QgsRasterLayer::blueBandName | ( | ) | const [inline] |
Accessor for blue band name mapping.
Definition at line 313 of file qgsrasterlayer.h.
Referenced by setMinimumMaximumUsingLastExtent(), and writeSymbology().
Accessor for ths raster layers pyramid list.
A pyramid list defines the POTENTIAL pyramids that can be in a raster. To know which of the pyramid layers ACTUALLY exists you need to look at the existsFlag member in each struct stored in the list.
Definition at line 408 of file qgsrasterlayer.cpp.
References QgsRasterDataProvider::buildPyramidList(), and mDataProvider.
QString QgsRasterLayer::buildPyramids | ( | const RasterPyramidList & | theRasterPyramidList, |
const QString & | theResamplingMethod = "NEAREST" , |
||
bool | theTryInternalFlag = false |
||
) | [slot] |
Create GDAL pyramid overviews.
Definition at line 401 of file qgsrasterlayer.cpp.
References QgsRasterDataProvider::buildPyramids(), and mDataProvider.
void QgsRasterLayer::buildSupportedRasterFileFilter | ( | QString & | theFileFiltersString | ) | [static] |
Builds the list of file filter strings to later be used by QgisApp::addRasterLayer() We query GDAL for a list of supported raster formats; we then build a list of file filter strings from that list.
We return a string that contains this list that is suitable for use in a QFileDialog::getOpenFileNames() call.
Definition at line 195 of file qgsrasterlayer.cpp.
References cast_to_fptr, loadProviderLibrary(), and QgsDebugMsg.
void QgsRasterLayer::closeDataProvider | ( | ) | [private] |
Close data provider and clear related members.
Definition at line 2391 of file qgsrasterlayer.cpp.
References mContrastEnhancementList, mDataProvider, mHasPyramids, mPyramidList, mRasterShader, mRasterStatsList, and QgsMapLayer::mValid.
QgsRasterLayer::ColorShadingAlgorithm QgsRasterLayer::colorShadingAlgorithm | ( | ) | const [inline] |
Accessor for color shader algorithm.
Definition at line 316 of file qgsrasterlayer.h.
Referenced by writeSymbology().
QString QgsRasterLayer::colorShadingAlgorithmAsString | ( | ) | const |
Accessor for color shader algorithm.
Definition at line 413 of file qgsrasterlayer.cpp.
References ColorRampShader, FreakOutShader, mColorShadingAlgorithm, PseudoColorShader, and UserDefinedShader.
Referenced by writeSymbology().
QList< QgsColorRampShader::ColorRampItem > * QgsRasterLayer::colorTable | ( | int | theBandNo | ) |
Get a pointer to the color table.
theBandNo | the band number |
Definition at line 584 of file qgsrasterlayer.cpp.
References mRasterStatsList.
Referenced by setDataProvider().
void QgsRasterLayer::computeMinimumMaximumEstimates | ( | int | theBand, |
double * | theMinMax | ||
) |
Wrapper for GDALComputeRasterMinMax with the estimate option.
theBand | The band (number) for which to estimate the min max values |
theMinMax | Pointer to a double[2] which hold the estimated min max |
Definition at line 440 of file qgsrasterlayer.cpp.
References bandCount(), QgsRasterDataProvider::maximumValue(), mDataProvider, and QgsRasterDataProvider::minimumValue().
Referenced by computeMinimumMaximumEstimates().
void QgsRasterLayer::computeMinimumMaximumEstimates | ( | QString | theBand, |
double * | theMinMax | ||
) |
Wrapper for GDALComputeRasterMinMax with the estimate option.
theBand | The band (name) for which to estimate the min max values |
theMinMax | Pointer to a double[2] which hold the estimated min max |
Definition at line 455 of file qgsrasterlayer.cpp.
References bandNumber(), and computeMinimumMaximumEstimates().
void QgsRasterLayer::computeMinimumMaximumEstimates | ( | int | theBand, |
double & | theMin, | ||
double & | theMax | ||
) |
Wrapper for GDALComputeRasterMinMax with the estimate option.
Definition at line 460 of file qgsrasterlayer.cpp.
References computeMinimumMaximumEstimates().
void QgsRasterLayer::computeMinimumMaximumFromLastExtent | ( | int | theBand, |
double * | theMinMax | ||
) |
Compute the actual minimum maximum pixel values based on the current (last) display extent.
theBand | The band (number) for which to calculate the min max values |
theMinMax | Pointer to a double[2] which hold the estimated min max |
Definition at line 472 of file qgsrasterlayer.cpp.
References bandCount(), QgsRasterDataProvider::dataType(), QgsRasterViewPort::drawableAreaXDim, QgsRasterViewPort::drawableAreaYDim, MathUtils::max(), mDataProvider, mLastViewPort, mNoDataValue, mValidNoDataValue, readData(), readValue(), and TINY_VALUE.
Referenced by computeMinimumMaximumFromLastExtent(), and setMinimumMaximumUsingLastExtent().
void QgsRasterLayer::computeMinimumMaximumFromLastExtent | ( | QString | theBand, |
double * | theMinMax | ||
) |
Compute the actual minimum maximum pixel values based on the current (last) display extent.
theBand | The band (name) for which to calculate the min max values |
theMinMax | Pointer to a double[2] which hold the estimated min max |
Definition at line 515 of file qgsrasterlayer.cpp.
References bandNumber(), and computeMinimumMaximumFromLastExtent().
void QgsRasterLayer::computeMinimumMaximumFromLastExtent | ( | int | theBand, |
double & | theMin, | ||
double & | theMax | ||
) |
Compute the actual minimum maximum pixel values based on the current (last) display extent.
Definition at line 520 of file qgsrasterlayer.cpp.
References computeMinimumMaximumFromLastExtent().
QgsContrastEnhancement * QgsRasterLayer::contrastEnhancement | ( | unsigned int | theBand | ) |
Get a pointer to the contrast enhancement for the selected band.
theBand | The band (number) for which to get the contrast enhancement for |
Definition at line 532 of file qgsrasterlayer.cpp.
References bandCount(), and mContrastEnhancementList.
Referenced by drawMultiBandColor(), and drawSingleBandGray().
QgsContrastEnhancement::ContrastEnhancementAlgorithm QgsRasterLayer::contrastEnhancementAlgorithm | ( | ) | [inline] |
Accessor for contrast enhancement algorithm.
Definition at line 319 of file qgsrasterlayer.h.
Referenced by drawMultiBandColor(), and drawSingleBandGray().
QString QgsRasterLayer::contrastEnhancementAlgorithmAsString | ( | ) | const |
Returns contrast enhancement algorithm as a string.
Definition at line 542 of file qgsrasterlayer.cpp.
References QgsContrastEnhancement::ClipToMinimumMaximum, mContrastEnhancementAlgorithm, QgsContrastEnhancement::NoEnhancement, QgsContrastEnhancement::StretchAndClipToMinimumMaximum, QgsContrastEnhancement::StretchToMinimumMaximum, and QgsContrastEnhancement::UserDefinedEnhancement.
Referenced by writeSymbology().
bool QgsRasterLayer::copySymbologySettings | ( | const QgsMapLayer & | theOther | ) | [virtual] |
Copies the symbology settings from another layer.
Returns true in case of success
Implements QgsMapLayer.
Definition at line 570 of file qgsrasterlayer.cpp.
References QgsMapLayer::type().
void QgsRasterLayer::dataChanged | ( | ) | [signal] |
This is emitted whenever data or metadata (e.g.
color table, extent) has changed
Reimplemented from QgsMapLayer.
Referenced by update().
Returns the data provider.
Definition at line 592 of file qgsrasterlayer.cpp.
References mDataProvider.
Referenced by QgsComposerMap::containsWMSLayer().
const QgsRasterDataProvider * QgsRasterLayer::dataProvider | ( | ) | const |
Returns the data provider in a const-correct manner.
Definition at line 600 of file qgsrasterlayer.cpp.
References mDataProvider.
bool QgsRasterLayer::draw | ( | QgsRenderContext & | rendererContext | ) | [virtual] |
This is called when the view on the raster layer needs to be redrawn.
Reimplemented from QgsMapLayer.
Definition at line 613 of file qgsrasterlayer.cpp.
References QgsRenderContext::coordinateTransform(), QgsMapLayer::crs(), QgsCoordinateTransform::destCRS(), QgsRenderContext::extent(), QgsRectangle::height(), QgsRectangle::intersect(), QgsRectangle::isEmpty(), QgsRenderContext::mapToPixel(), QgsMapToPixel::mapUnitsPerPixel(), mBlueBandName, mDataProvider, mGrayBandName, mGreenBandName, mHeight, mLastViewPort, QgsMapLayer::mLayerExtent, mRedBandName, QgsMapLayer::mTransparencyLevel, mWidth, QgsRenderContext::painter(), QgsDebugMsg, QgsDebugMsgLevel, QgsRenderContext::rasterScaleFactor(), QgsRenderContext::scaleFactor(), QgsRectangle::set(), QgsRasterDataProvider::setDpi(), QgsPoint::setX(), QgsMapToPixel::toMapCoordinatesF(), QgsRectangle::toString(), QgsMapToPixel::transform(), QgsCoordinateTransform::transformBoundingBox(), update(), QgsRectangle::width(), QgsRectangle::xMaximum(), QgsRectangle::xMinimum(), QgsRectangle::yMaximum(), and QgsRectangle::yMinimum().
Referenced by thumbnailAsImage(), and thumbnailAsPixmap().
void QgsRasterLayer::draw | ( | QPainter * | theQPainter, |
QgsRasterViewPort * | myRasterViewPort, | ||
const QgsMapToPixel * | theQgsMapToPixel = 0 |
||
) |
This is an overloaded version of the draw() function that is called by both draw() and thumbnailAsPixmap.
Definition at line 770 of file qgsrasterlayer.cpp.
References bandNumber(), drawMultiBandColor(), drawMultiBandSingleBandGray(), drawMultiBandSingleBandPseudoColor(), drawPalettedMultiBandColor(), drawPalettedSingleBandColor(), drawPalettedSingleBandGray(), drawPalettedSingleBandPseudoColor(), drawSingleBandColorData(), drawSingleBandGray(), drawSingleBandPseudoColor(), mBlueBandName, mDrawingStyle, mGrayBandName, mGreenBandName, mRedBandName, MultiBandColor, MultiBandSingleBandGray, MultiBandSingleBandPseudoColor, PalettedColor, PalettedMultiBandColor, PalettedSingleBandGray, PalettedSingleBandPseudoColor, QgsDebugMsg, SingleBandColorDataStyle, SingleBandGray, SingleBandPseudoColor, and TRSTRING_NOT_SET.
DrawingStyle QgsRasterLayer::drawingStyle | ( | ) | [inline] |
Accessor for drawing style.
Definition at line 325 of file qgsrasterlayer.h.
Referenced by setMinimumMaximumUsingDataset(), and setMinimumMaximumUsingLastExtent().
QString QgsRasterLayer::drawingStyleAsString | ( | ) | const |
Returns a string representation of drawing style.
Implemented mainly for serialisation / deserialisation of settings to xml. NOTE: May be deprecated in the future!. DrawingStyle drawingStyle() instead.
Definition at line 932 of file qgsrasterlayer.cpp.
References mDrawingStyle, MultiBandColor, MultiBandSingleBandGray, MultiBandSingleBandPseudoColor, PalettedColor, PalettedMultiBandColor, PalettedSingleBandGray, PalettedSingleBandPseudoColor, SingleBandColorDataStyle, SingleBandGray, and SingleBandPseudoColor.
Referenced by legendAsPixmap(), readSymbology(), and writeSymbology().
void QgsRasterLayer::drawMultiBandColor | ( | QPainter * | theQPainter, |
QgsRasterViewPort * | theRasterViewPort, | ||
const QgsMapToPixel * | theQgsMapToPixel | ||
) | [private] |
Drawing routine for multiband image.
Definition at line 3569 of file qgsrasterlayer.cpp.
References QgsRasterTransparency::alphaValue(), bandNumber(), bandStatistics(), contrastEnhancement(), contrastEnhancementAlgorithm(), QgsRasterDataProvider::dataType(), QgsRasterViewPort::drawableAreaXDim, QgsContrastEnhancement::enhanceContrast(), QgsContrastEnhancement::isValueInDisplayableRange(), QgsRasterDataProvider::maximumValue(), mBlueBandName, mDataProvider, QgsRasterBandStats::mean, mGeoTransform, mGreenBandName, QgsRasterDataProvider::minimumValue(), mInvertColor, mNoDataValue, mRasterTransparency, mRedBandName, mRGBMinimumMaximumEstimated, mStandardDeviations, mTransparencyBandName, QgsMapLayer::mTransparencyLevel, mUserDefinedRGBMinimumMaximum, mValidNoDataValue, QgsRasterImageBuffer::nextScanLine(), QgsContrastEnhancement::NoEnhancement, QgsDebugMsg, readValue(), QgsRasterImageBuffer::reset(), setMaximumValue(), setMinimumValue(), QgsRasterImageBuffer::setWritingEnabled(), QgsRasterBandStats::stdDev, and TINY_VALUE.
Referenced by draw().
void QgsRasterLayer::drawMultiBandSingleBandGray | ( | QPainter * | theQPainter, |
QgsRasterViewPort * | theRasterViewPort, | ||
const QgsMapToPixel * | theQgsMapToPixel, | ||
int | theBandNoInt | ||
) | [private] |
Drawing routine for multiband image, rendered as a single band image in grayscale.
Definition at line 3762 of file qgsrasterlayer.cpp.
References drawSingleBandGray().
Referenced by draw().
void QgsRasterLayer::drawMultiBandSingleBandPseudoColor | ( | QPainter * | theQPainter, |
QgsRasterViewPort * | theRasterViewPort, | ||
const QgsMapToPixel * | theQgsMapToPixel, | ||
int | theBandNoInt | ||
) | [private] |
Drawing routine for multiband image, rendered as a single band image in pseudocolor.
Definition at line 3769 of file qgsrasterlayer.cpp.
References drawSingleBandPseudoColor().
Referenced by draw().
void QgsRasterLayer::drawPalettedMultiBandColor | ( | QPainter * | theQPainter, |
QgsRasterViewPort * | theRasterViewPort, | ||
const QgsMapToPixel * | theQgsMapToPixel, | ||
int | theBandNo | ||
) | [private] |
Drawing routine for paletted multiband image.
This method is used to render a paletted raster layer as a color image -- currently not supported.
theQPainter | pointer to the QPainter onto which the layer should be drawn. |
theRasterViewPort | pointer to the ViewPort struct containing dimensions of viewable area and subset area to be extracted from data file. |
theQgsMapToPixel | transformation coordinate to map canvas pixel |
theBandNo | the number of the band which should be rendered. |
Definition at line 4137 of file qgsrasterlayer.cpp.
References QgsDebugMsg.
Referenced by draw().
void QgsRasterLayer::drawPalettedSingleBandColor | ( | QPainter * | theQPainter, |
QgsRasterViewPort * | theRasterViewPort, | ||
const QgsMapToPixel * | theQgsMapToPixel, | ||
int | theBandNo | ||
) | [private] |
Drawing routine for single band with a color map.
This method is used to render a single band with a color map.
theQPainter | pointer to the QPainter onto which the layer should be drawn. |
theRasterViewPort | pointer to the ViewPort struct containing dimensions of viewable area and subset area to be extracted from data file. |
theQgsMapToPixel | transformation coordinate to map canvas pixel |
theBandNo | band number |
Definition at line 3783 of file qgsrasterlayer.cpp.
References QgsRasterTransparency::alphaValue(), bandNumber(), QgsRasterDataProvider::dataType(), QgsRasterViewPort::drawableAreaXDim, mDataProvider, mGeoTransform, mInvertColor, mNoDataValue, mRasterShader, mRasterTransparency, mTransparencyBandName, QgsMapLayer::mTransparencyLevel, mValidNoDataValue, QgsRasterImageBuffer::nextScanLine(), QgsDebugMsg, readValue(), QgsRasterImageBuffer::reset(), QgsRasterImageBuffer::setWritingEnabled(), QgsRasterShader::shade(), and TINY_VALUE.
Referenced by draw().
void QgsRasterLayer::drawPalettedSingleBandGray | ( | QPainter * | theQPainter, |
QgsRasterViewPort * | theRasterViewPort, | ||
const QgsMapToPixel * | theQgsMapToPixel, | ||
int | theBandNo | ||
) | [private] |
Drawing routine for paletted image, rendered as a single band image in grayscale.
This method is used to render a paletted raster layer as a gray image.
theQPainter | pointer to the QPainter onto which the layer should be drawn. |
theRasterViewPort | pointer to the ViewPort struct containing dimensions of viewable area and subset area to be extracted from data file. |
theQgsMapToPixel | transformation between map coordinates and canvas pixels |
theBandNo | band number |
Definition at line 3895 of file qgsrasterlayer.cpp.
References QgsRasterTransparency::alphaValue(), bandNumber(), QgsRasterDataProvider::dataType(), QgsRasterViewPort::drawableAreaXDim, mDataProvider, mGeoTransform, mInvertColor, mNoDataValue, mRasterShader, mRasterTransparency, mTransparencyBandName, QgsMapLayer::mTransparencyLevel, mValidNoDataValue, QgsRasterImageBuffer::nextScanLine(), QgsDebugMsg, readValue(), QgsRasterImageBuffer::reset(), QgsRasterImageBuffer::setWritingEnabled(), QgsRasterShader::shade(), and TINY_VALUE.
Referenced by draw().
void QgsRasterLayer::drawPalettedSingleBandPseudoColor | ( | QPainter * | theQPainter, |
QgsRasterViewPort * | theRasterViewPort, | ||
const QgsMapToPixel * | theQgsMapToPixel, | ||
int | theBandNo | ||
) | [private] |
Drawing routine for paletted image, rendered as a single band image in pseudocolor.
This method is used to render a paletted raster layer as a pseudocolor image.
theQPainter | - pointer to the QPainter onto which the layer should be drawn. |
theRasterViewPort | - pointer to the ViewPort struct containing dimensions of viewable area and subset area to be extracted from data file. |
theQgsMapToPixel | transformation between map coordinates and canvas pixels |
theBandNo | band number gray. |
Definition at line 4010 of file qgsrasterlayer.cpp.
References QgsRasterTransparency::alphaValue(), bandNumber(), bandStatistics(), QgsRasterDataProvider::dataType(), QgsRasterViewPort::drawableAreaXDim, QgsRasterBandStats::maximumValue, mDataProvider, QgsRasterBandStats::mean, mGeoTransform, QgsRasterBandStats::minimumValue, mInvertColor, mNoDataValue, mRasterShader, mRasterTransparency, mStandardDeviations, mTransparencyBandName, QgsMapLayer::mTransparencyLevel, mValidNoDataValue, QgsRasterImageBuffer::nextScanLine(), QgsDebugMsg, readValue(), QgsRasterImageBuffer::reset(), QgsRasterShader::setMaximumValue(), QgsRasterShader::setMinimumValue(), QgsRasterImageBuffer::setWritingEnabled(), QgsRasterShader::shade(), QgsRasterBandStats::stdDev, and TINY_VALUE.
Referenced by draw().
void QgsRasterLayer::drawSingleBandColorData | ( | QPainter * | theQPainter, |
QgsRasterViewPort * | theRasterViewPort, | ||
const QgsMapToPixel * | theQgsMapToPixel, | ||
int | theBandNoInt | ||
) | [private] |
Drawing routine for color type data.
Definition at line 3538 of file qgsrasterlayer.cpp.
References QgsRasterViewPort::drawableAreaXDim, mDataProvider, mGeoTransform, QgsMapLayer::mTransparencyLevel, QgsRasterImageBuffer::nextScanLine(), QgsDebugMsg, and QgsRasterImageBuffer::reset().
Referenced by draw().
void QgsRasterLayer::drawSingleBandGray | ( | QPainter * | theQPainter, |
QgsRasterViewPort * | theRasterViewPort, | ||
const QgsMapToPixel * | theQgsMapToPixel, | ||
int | theBandNoInt | ||
) | [private] |
Drawing routine for single band grayscale image.
Definition at line 4143 of file qgsrasterlayer.cpp.
References QgsRasterTransparency::alphaValue(), bandNumber(), bandStatistics(), contrastEnhancement(), contrastEnhancementAlgorithm(), QgsRasterDataProvider::dataType(), QgsRasterViewPort::drawableAreaXDim, QgsContrastEnhancement::enhanceContrast(), QgsContrastEnhancement::isValueInDisplayableRange(), QgsRasterDataProvider::maximumValue(), mDataProvider, QgsRasterBandStats::mean, mGeoTransform, mGrayMinimumMaximumEstimated, QgsRasterDataProvider::minimumValue(), mInvertColor, mNoDataValue, mRasterTransparency, mStandardDeviations, mTransparencyBandName, QgsMapLayer::mTransparencyLevel, mUserDefinedGrayMinimumMaximum, mValidNoDataValue, QgsRasterImageBuffer::nextScanLine(), QgsContrastEnhancement::NoEnhancement, QgsDebugMsg, readValue(), QgsRasterImageBuffer::reset(), setMaximumValue(), setMinimumValue(), QgsRasterImageBuffer::setWritingEnabled(), QgsRasterBandStats::stdDev, and TINY_VALUE.
Referenced by draw(), and drawMultiBandSingleBandGray().
void QgsRasterLayer::drawSingleBandPseudoColor | ( | QPainter * | theQPainter, |
QgsRasterViewPort * | theRasterViewPort, | ||
const QgsMapToPixel * | theQgsMapToPixel, | ||
int | theBandNoInt | ||
) | [private] |
Drawing routine for single band grayscale image, rendered in pseudocolor.
Definition at line 4263 of file qgsrasterlayer.cpp.
References QgsRasterTransparency::alphaValue(), bandNumber(), bandStatistics(), QgsRasterDataProvider::dataType(), QgsRasterViewPort::drawableAreaXDim, QgsRasterBandStats::maximumValue, mDataProvider, QgsRasterBandStats::mean, mGeoTransform, QgsRasterBandStats::minimumValue, mInvertColor, mNoDataValue, mRasterShader, mRasterTransparency, mStandardDeviations, mTransparencyBandName, QgsMapLayer::mTransparencyLevel, mValidNoDataValue, QgsRasterImageBuffer::nextScanLine(), QgsDebugMsg, readValue(), QgsRasterImageBuffer::reset(), QgsRasterShader::setMaximumValue(), QgsRasterShader::setMinimumValue(), QgsRasterImageBuffer::setWritingEnabled(), QgsRasterShader::shade(), QgsRasterBandStats::stdDev, and TINY_VALUE.
Referenced by draw(), and drawMultiBandSingleBandPseudoColor().
QString QgsRasterLayer::generateBandName | ( | int | ) | [private] |
helper function to create zero padded band names
QString QgsRasterLayer::grayBandName | ( | ) | const [inline] |
Accessor for gray band name mapping.
Definition at line 328 of file qgsrasterlayer.h.
Referenced by setMinimumMaximumUsingDataset(), setMinimumMaximumUsingLastExtent(), and writeSymbology().
QString QgsRasterLayer::greenBandName | ( | ) | const [inline] |
Accessor for green band name mapping.
Definition at line 331 of file qgsrasterlayer.h.
Referenced by setMinimumMaximumUsingDataset(), setMinimumMaximumUsingLastExtent(), and writeSymbology().
bool QgsRasterLayer::hasBand | ( | const QString & | theBandName | ) | [private] |
Find out whether a given band exists.
This method looks to see if a given band name exists.
Definition at line 4396 of file qgsrasterlayer.cpp.
References QgsRasterDataProvider::bandCount(), QgsRasterDataProvider::colorInterpretationName(), QgsLogger::debug(), mDataProvider, QgsDebugMsg, and QgsDebugMsgLevel.
Referenced by paletteAsPixmap().
bool QgsRasterLayer::hasCompatibleSymbology | ( | const QgsMapLayer & | theOther | ) | const [virtual] |
Checks if symbology is the same as another layers.
Implements QgsMapLayer.
Definition at line 978 of file qgsrasterlayer.cpp.
References QgsMapLayer::type().
bool QgsRasterLayer::hasPyramids | ( | ) | [inline] |
Accessor for mHasPyramids (READ ONLY)
Definition at line 334 of file qgsrasterlayer.h.
bool QgsRasterLayer::hasStatistics | ( | int | theBandNo | ) |
Check whether a given band number has stats associated with it.
theBandNo | The number of the band to check |
Definition at line 992 of file qgsrasterlayer.cpp.
References mRasterStatsList.
Referenced by metadata().
bool QgsRasterLayer::hasUserDefinedGrayMinimumMaximum | ( | ) | const [inline] |
Accessor for mUserDefinedGrayMinimumMaximum.
Definition at line 337 of file qgsrasterlayer.h.
Referenced by writeSymbology().
bool QgsRasterLayer::hasUserDefinedRGBMinimumMaximum | ( | ) | const [inline] |
Accessor for mUserDefinedRGBMinimumMaximum.
Definition at line 340 of file qgsrasterlayer.h.
Referenced by writeSymbology().
int QgsRasterLayer::height | ( | ) | [inline] |
Accessor that returns the height of the (unclipped) raster.
Definition at line 343 of file qgsrasterlayer.h.
bool QgsRasterLayer::identify | ( | const QgsPoint & | thePoint, |
QMap< QString, QString > & | theResults | ||
) |
Identify raster value(s) found on the point position.
thePoint | the QgsPoint for which to obtain pixel values |
theResults | QMap to hold the pixel values at thePoint for each layer in the raster file |
Definition at line 1010 of file qgsrasterlayer.cpp.
References QgsRasterDataProvider::identify(), mDataProvider, mProviderKey, and QgsDebugMsg.
QString QgsRasterLayer::identifyAsHtml | ( | const QgsPoint & | thePoint | ) |
Identify arbitrary details from the WMS server found on the point position.
thePoint | an image pixel coordinate in the last requested extent of layer. |
Definition at line 1041 of file qgsrasterlayer.cpp.
References QgsRasterDataProvider::identifyAsHtml(), mDataProvider, and mProviderKey.
QString QgsRasterLayer::identifyAsText | ( | const QgsPoint & | thePoint | ) |
Identify arbitrary details from the WMS server found on the point position.
thePoint | an image pixel coordinate in the last requested extent of layer. |
Definition at line 1024 of file qgsrasterlayer.cpp.
References QgsRasterDataProvider::identifyAsText(), mDataProvider, and mProviderKey.
void QgsRasterLayer::init | ( | ) |
Initialize default values.
Definition at line 1983 of file qgsrasterlayer.cpp.
References QgsRasterViewPort::drawableAreaXDim, QgsRasterViewPort::drawableAreaYDim, GrayOrUndefined, mBandCount, mBlueBandName, mColorShadingAlgorithm, mContrastEnhancementAlgorithm, mDrawingStyle, mGeoTransform, mGrayBandName, mGrayMinimumMaximumEstimated, mGreenBandName, mHasPyramids, mLastViewPort, mNoDataValue, mRasterShader, mRasterType, mRedBandName, mRGBMinimumMaximumEstimated, mTransparencyBandName, mUserDefinedGrayMinimumMaximum, mUserDefinedRGBMinimumMaximum, mValidNoDataValue, QgsContrastEnhancement::NoEnhancement, TRSTRING_NOT_SET, UndefinedDrawingStyle, and UndefinedShader.
Referenced by QgsRasterLayer(), readXml(), and update().
bool QgsRasterLayer::invertHistogram | ( | ) | const [inline] |
Accessor to find out whether the histogram should be inverted.
Definition at line 346 of file qgsrasterlayer.h.
Referenced by writeSymbology().
bool QgsRasterLayer::isEditable | ( | ) | const [virtual] |
Currently returns always false.
Reimplemented from QgsMapLayer.
Definition at line 1056 of file qgsrasterlayer.cpp.
bool QgsRasterLayer::isGrayMinimumMaximumEstimated | ( | ) | const [inline] |
Accessor for mGrayMinimumMaximumEstimated.
Definition at line 352 of file qgsrasterlayer.h.
Referenced by writeSymbology().
bool QgsRasterLayer::isNoDataValueValid | ( | ) | const [inline] |
Is the NoDataValue Valid.
Definition at line 349 of file qgsrasterlayer.h.
bool QgsRasterLayer::isRGBMinimumMaximumEstimated | ( | ) | const [inline] |
Accessor for mRGBMinimumMaximumEstimated.
Definition at line 355 of file qgsrasterlayer.h.
Referenced by writeSymbology().
bool QgsRasterLayer::isValidRasterFileName | ( | const QString & | theFileNameQString, |
QString & | retError | ||
) | [static] |
This helper checks to see whether the file name appears to be a valid raster file name.
If the file name looks like it could be valid, but some sort of error occurs in processing the file, the error is returned in retError.
Definition at line 218 of file qgsrasterlayer.cpp.
References cast_to_fptr, loadProviderLibrary(), and QgsDebugMsg.
Referenced by isValidRasterFileName().
bool QgsRasterLayer::isValidRasterFileName | ( | const QString & | theFileNameQString | ) | [static] |
Definition at line 239 of file qgsrasterlayer.cpp.
References isValidRasterFileName().
QString QgsRasterLayer::lastError | ( | ) | [virtual] |
[ data provider interface ] If an operation returns 0 (e.g.
draw()), this function returns the text of the error associated with the failure
Reimplemented from QgsMapLayer.
Definition at line 1061 of file qgsrasterlayer.cpp.
References mError.
QString QgsRasterLayer::lastErrorTitle | ( | ) | [virtual] |
[ data provider interface ] If an operation returns 0 (e.g.
draw()), this function returns the text of the error associated with the failure
Reimplemented from QgsMapLayer.
Definition at line 1066 of file qgsrasterlayer.cpp.
References mErrorCaption.
QDateTime QgsRasterLayer::lastModified | ( | const QString & | name | ) | [static] |
Return time stamp for given file name.
Definition at line 245 of file qgsrasterlayer.cpp.
References QgsDebugMsg.
Referenced by setDataProvider().
QPixmap QgsRasterLayer::legendAsPixmap | ( | ) |
Get a legend image for this layer.
This is an overloaded version of the legendAsPixmap( bool ) assumes false for the legend name flag.
Definition at line 1075 of file qgsrasterlayer.cpp.
Referenced by QgsLegendModel::addRasterLayerItem().
QPixmap QgsRasterLayer::legendAsPixmap | ( | bool | theWithNameFlag | ) |
Overloaded version of above function that can print layer name onto legend.
theWithNameFlag | - boolena flag whether to overlay the legend name in the text |
Definition at line 1084 of file qgsrasterlayer.cpp.
References QgsApplication::activeThemePath(), QgsRasterDataProvider::colorInterpretationName(), drawingStyleAsString(), FreakOutShader, mColorShadingAlgorithm, mDataProvider, mDrawingStyle, mHasPyramids, mInvertColor, mProviderKey, MultiBandColor, MultiBandSingleBandGray, MultiBandSingleBandPseudoColor, QgsMapLayer::name(), PalettedColor, PalettedMultiBandColor, PalettedSingleBandGray, PalettedSingleBandPseudoColor, QgsDebugMsg, SingleBandGray, and SingleBandPseudoColor.
QPixmap QgsRasterLayer::legendAsPixmap | ( | int | theLabelCount | ) |
Use this method when you want an annotated legend suitable for print output etc.
theLabelCount | number of vertical labels to display |
Definition at line 1352 of file qgsrasterlayer.cpp.
References QgsRasterDataProvider::colorInterpretationName(), FreakOutShader, mColorShadingAlgorithm, mDataProvider, mDrawingStyle, mInvertColor, MultiBandColor, MultiBandSingleBandGray, MultiBandSingleBandPseudoColor, QgsMapLayer::name(), PalettedMultiBandColor, PalettedSingleBandGray, PalettedSingleBandPseudoColor, QgsDebugMsg, SingleBandGray, and SingleBandPseudoColor.
QgsRasterDataProvider * QgsRasterLayer::loadProvider | ( | QString | theProviderKey, |
QString | theDataSource = 0 |
||
) | [static] |
Definition at line 2064 of file qgsrasterlayer.cpp.
References cast_to_fptr, loadProviderLibrary(), QgsDebugMsg, and QgsLogger::warning().
Referenced by setDataProvider().
QLibrary * QgsRasterLayer::loadProviderLibrary | ( | QString | theProviderKey | ) | [static] |
Definition at line 2023 of file qgsrasterlayer.cpp.
References QgsProviderRegistry::instance(), QgsProviderRegistry::library(), QgsDebugMsg, and QgsLogger::warning().
Referenced by buildSupportedRasterFileFilter(), isValidRasterFileName(), and loadProvider().
double QgsRasterLayer::maximumValue | ( | unsigned int | theBand | ) |
Accessor for maximum value user for contrast enhancement.
theBand | the band number for which to get the maximum pixel value |
Definition at line 1582 of file qgsrasterlayer.cpp.
References bandCount(), and mContrastEnhancementList.
Referenced by maximumValue().
double QgsRasterLayer::maximumValue | ( | QString | theBand | ) |
Accessor for maximum value user for contrast enhancement.
theBand | the band name for which to get the maximum pixel value |
Definition at line 1596 of file qgsrasterlayer.cpp.
References bandNumber(), and maximumValue().
QString QgsRasterLayer::metadata | ( | ) |
Obtain GDAL Metadata for this layer.
Definition at line 1607 of file qgsrasterlayer.cpp.
References bandCount(), bandName(), bandStatistics(), QgsRasterDataProvider::dataType(), QgsDataProvider::description(), QgsRasterBandStats::elementCount, QgsDataProvider::extent(), hasStatistics(), QgsRasterBandStats::maximumValue, QgsMapLayer::mCRS, mDataProvider, QgsRasterBandStats::mean, QgsRasterDataProvider::metadata(), QgsRasterBandStats::minimumValue, mNoDataValue, mValidNoDataValue, QgsDebugMsg, QgsRasterBandStats::range, QgsRasterBandStats::stdDev, QgsRasterBandStats::sum, QgsRasterBandStats::sumOfSquares, QgsCoordinateReferenceSystem::toProj4(), and QgsRectangle::toString().
double QgsRasterLayer::minimumValue | ( | unsigned int | theBand | ) |
Accessor for minimum value user for contrast enhancement.
theBand | the band number for which to get the minimum pixel value |
Definition at line 1824 of file qgsrasterlayer.cpp.
References bandCount(), and mContrastEnhancementList.
Referenced by minimumValue().
double QgsRasterLayer::minimumValue | ( | QString | theBand | ) |
Accessor for minimum value user for contrast enhancement.
theBand | the band name for which to get the minimum pixel value |
Definition at line 1838 of file qgsrasterlayer.cpp.
References bandNumber(), and minimumValue().
double QgsRasterLayer::noDataValue | ( | bool * | isValid = 0 | ) | [inline] |
Accessor that returns the NO_DATA entry for this raster.
Definition at line 358 of file qgsrasterlayer.h.
void QgsRasterLayer::onProgress | ( | int | theType, |
double | theProgress, | ||
QString | theMesssage | ||
) | [slot] |
recieve progress signal from provider
Definition at line 2851 of file qgsrasterlayer.cpp.
References progressUpdate(), and QgsDebugMsg.
Referenced by setDataProvider().
QPixmap QgsRasterLayer::paletteAsPixmap | ( | int | theBandNumber = 1 | ) |
Get an 100x100 pixmap of the color palette.
If the layer has no palette a white pixmap will be returned
theBandNumber | the number of the band to use for generating a pixmap of the associated palette |
Definition at line 1847 of file qgsrasterlayer.cpp.
References QgsRasterDataProvider::colorTable(), QgsColorRampShader::DISCRETE, hasBand(), mDataProvider, mProviderKey, QgsDebugMsg, QgsColorRampShader::setColorRampItemList(), QgsColorRampShader::setColorRampType(), and QgsColorRampShader::shade().
void QgsRasterLayer::populateHistogram | ( | int | theBandNoInt, |
int | theBinCountInt = 256 , |
||
bool | theIgnoreOutOfRangeFlag = true , |
||
bool | theThoroughBandScanFlag = false |
||
) | [slot] |
Populate the histogram vector for a given band.
Definition at line 1911 of file qgsrasterlayer.cpp.
References bandStatistics(), mDataProvider, and QgsRasterDataProvider::populateHistogram().
void QgsRasterLayer::progressUpdate | ( | int | theValue | ) | [signal] |
Signal for notifying listeners of long running processes.
Referenced by onProgress(), and showProgress().
QString QgsRasterLayer::projectionWkt | ( | ) | [private] |
Query GDAL to find out the Wkt projection string for this layer.
Definition at line 4422 of file qgsrasterlayer.cpp.
References QgsDataProvider::crs(), mDataProvider, and QgsCoordinateReferenceSystem::toWkt().
QString QgsRasterLayer::providerKey | ( | ) | const |
[ data provider interface ] Which provider is being used for this Raster Layer?
Definition at line 1917 of file qgsrasterlayer.cpp.
References mProviderKey.
QgsRasterShader* QgsRasterLayer::rasterShader | ( | ) | [inline] |
Accessor for raster shader.
Definition at line 364 of file qgsrasterlayer.h.
QgsRasterTransparency* QgsRasterLayer::rasterTransparency | ( | ) | [inline] |
Returns a pointer to the transparency object.
Definition at line 361 of file qgsrasterlayer.h.
LayerType QgsRasterLayer::rasterType | ( | ) | [inline] |
Accessor for raster layer type (which is a read only property)
Definition at line 367 of file qgsrasterlayer.h.
Referenced by setMinimumMaximumUsingDataset(), and setMinimumMaximumUsingLastExtent().
double QgsRasterLayer::rasterUnitsPerPixel | ( | ) |
Returns the number of raster units per each raster pixel.
In a world file, this is normally the first row (without the sign)
Definition at line 1932 of file qgsrasterlayer.cpp.
References QgsRasterDataProvider::capabilities(), QgsRasterDataProvider::ExactResolution, QgsDataProvider::extent(), mDataProvider, QgsRectangle::width(), and QgsRasterDataProvider::xSize().
bool QgsRasterLayer::readColorTable | ( | int | theBandNumber, |
QList< QgsColorRampShader::ColorRampItem > * | theList | ||
) |
Read color table from GDAL raster band.
Definition at line 4947 of file qgsrasterlayer.cpp.
References QgsRasterDataProvider::colorTable(), and mDataProvider.
void * QgsRasterLayer::readData | ( | int | bandNo, |
QgsRasterViewPort * | viewPort | ||
) | [private] |
Allocate memory and load data to that allocated memory.
Definition at line 4432 of file qgsrasterlayer.cpp.
References QgsRasterDataProvider::dataTypeSize(), QgsRasterViewPort::drawableAreaXDim, QgsRasterViewPort::drawableAreaYDim, mDataProvider, QgsRasterViewPort::mDestCRS, QgsRasterViewPort::mDrawnExtent, QgsRasterViewPort::mSrcCRS, QgsMapLayer::name(), QgsDebugMsg, QgsRasterDataProvider::readBlock(), QgsRectangle::xMaximum(), QgsRectangle::xMinimum(), QgsRectangle::yMaximum(), and QgsRectangle::yMinimum().
Referenced by computeMinimumMaximumFromLastExtent().
bool QgsRasterLayer::readFile | ( | const QString & | fileName | ) | [private] |
Load the given raster file.
Definition at line 4472 of file qgsrasterlayer.cpp.
References QgsMapLayer::mValid.
bool QgsRasterLayer::readSymbology | ( | const QDomNode & | node, |
QString & | errorMessage | ||
) | [protected, virtual] |
Read the symbology for the current layer from the Dom node supplied.
Implements QgsMapLayer.
Definition at line 2867 of file qgsrasterlayer.cpp.
References QgsRasterTransparency::TransparentThreeValuePixel::blue, QgsColorRampShader::ColorRampItem::color, drawingStyleAsString(), QgsRasterTransparency::TransparentThreeValuePixel::green, QgsColorRampShader::ColorRampItem::label, mGrayBandName, mGreenBandName, mNoDataValue, mRasterShader, mRasterTransparency, mRedBandName, mValidNoDataValue, QgsRasterTransparency::TransparentThreeValuePixel::percentTransparent, QgsRasterTransparency::TransparentSingleValuePixel::percentTransparent, QgsRasterTransparency::TransparentSingleValuePixel::pixelValue, QgsDebugMsg, QgsRasterShader::rasterShaderFunction(), QgsRasterTransparency::TransparentThreeValuePixel::red, setBlueBandName(), QgsColorRampShader::setColorRampItemList(), QgsColorRampShader::setColorRampType(), setColorShadingAlgorithm(), setContrastEnhancementAlgorithm(), setDrawingStyle(), setGrayBandName(), setGrayMinimumMaximumEstimated(), setGreenBandName(), setInvertHistogram(), setMaximumValue(), setMinimumValue(), setNoDataValue(), setRedBandName(), setRGBMinimumMaximumEstimated(), setStandardDeviations(), QgsRasterTransparency::setTransparentSingleValuePixelList(), QgsRasterTransparency::setTransparentThreeValuePixelList(), setUserDefinedGrayMinimumMaximum(), setUserDefinedRGBMinimumMaximum(), and QgsColorRampShader::ColorRampItem::value.
Referenced by readXml().
double QgsRasterLayer::readValue | ( | void * | data, |
int | type, | ||
int | index | ||
) | [inline, private] |
Read a raster value given position from memory block created by readData()
Definition at line 4481 of file qgsrasterlayer.cpp.
References QgsRasterDataProvider::Byte, QgsRasterDataProvider::Float32, QgsRasterDataProvider::Float64, QgsRasterDataProvider::Int16, QgsRasterDataProvider::Int32, mNoDataValue, mValidNoDataValue, QgsRasterDataProvider::UInt16, QgsRasterDataProvider::UInt32, and QgsLogger::warning().
Referenced by computeMinimumMaximumFromLastExtent(), drawMultiBandColor(), drawPalettedSingleBandColor(), drawPalettedSingleBandGray(), drawPalettedSingleBandPseudoColor(), drawSingleBandGray(), and drawSingleBandPseudoColor().
bool QgsRasterLayer::readXml | ( | QDomNode & | layer_node | ) | [protected, virtual] |
Reads layer specific state from project file Dom node.
Raster layer project file XML of form:
<maplayer type="raster" visible="1" showInOverviewFlag="1"> <layername>Wynoochee_dem</layername> <datasource>/home/mcoletti/mnt/MCOLETTIF8F9/c/Toolkit_Course/Answers/Training_Data/wynoochee_dem.img</datasource> <zorder>0</zorder> <transparencyLevelInt>255</transparencyLevelInt> <rasterproperties> <mDrawingStyle>SingleBandGray</mDrawingStyle> <mInvertColor boolean="false"/> <mStandardDeviations>0</mStandardDeviations> <mRedBandName>Not Set</mRedBandName> <mGreenBandName>Not Set</mGreenBandName> <mBlueBandName>Not Set</mBlueBandName> <mGrayBandName>Undefined</mGrayBandName> </rasterproperties> </maplayer>
Reimplemented from QgsMapLayer.
Definition at line 3084 of file qgsrasterlayer.cpp.
References QgsCoordinateReferenceSystem::authid(), bandName(), closeDataProvider(), QgsMapLayer::crs(), init(), mBlueBandName, mCrs, mDrawingStyle, mFormat, mGrayBandName, mGreenBandName, mLayers, mProviderKey, mRedBandName, mStyles, MultiBandColor, QgsDebugMsg, readSymbology(), setDataProvider(), SingleBandColorDataStyle, and TRSTRING_NOT_SET.
QString QgsRasterLayer::redBandName | ( | ) | const [inline] |
Accessor for red band name (allows alternate mappings e.g.
map blue as red color)
Definition at line 370 of file qgsrasterlayer.h.
Referenced by setMinimumMaximumUsingDataset(), setMinimumMaximumUsingLastExtent(), and writeSymbology().
void QgsRasterLayer::registerGdalDrivers | ( | ) | [static] |
ensures that GDAL drivers are registered, but only once
Definition at line 4940 of file qgsrasterlayer.cpp.
void QgsRasterLayer::reload | ( | ) | [virtual] |
Synchronises with changes in the datasource.
Reimplemented from QgsMapLayer.
Definition at line 605 of file qgsrasterlayer.cpp.
References mDataProvider, and QgsDataProvider::reloadData().
void QgsRasterLayer::resetNoDataValue | ( | ) |
Simple reset function that set the noDataValue back to the value stored in the first raster band.
Definition at line 1949 of file qgsrasterlayer.cpp.
References QgsRasterDataProvider::bandCount(), QgsRasterDataProvider::isNoDataValueValid(), MathUtils::max(), mDataProvider, mNoDataValue, mValidNoDataValue, QgsRasterDataProvider::noDataValue(), and setNoDataValue().
void QgsRasterLayer::setBlueBandName | ( | const QString & | theBandName | ) |
Mutator for blue band name mapping.
Definition at line 1978 of file qgsrasterlayer.cpp.
References mBlueBandName, and validateBandName().
Referenced by readSymbology().
void QgsRasterLayer::setColorShadingAlgorithm | ( | QgsRasterLayer::ColorShadingAlgorithm | theShaderAlgorithm | ) |
Mutator for color shader algorithm.
Definition at line 2406 of file qgsrasterlayer.cpp.
References ColorRampShader, FreakOutShader, mColorShadingAlgorithm, mRasterShader, PseudoColorShader, QgsDebugMsg, QgsRasterShader::setRasterShaderFunction(), and UserDefinedShader.
Referenced by readSymbology(), setColorShadingAlgorithm(), and setDataProvider().
void QgsRasterLayer::setColorShadingAlgorithm | ( | QString | theShaderAlgorithm | ) |
Mutator for color shader algorithm.
Definition at line 2441 of file qgsrasterlayer.cpp.
References ColorRampShader, FreakOutShader, PseudoColorShader, QgsDebugMsg, setColorShadingAlgorithm(), UndefinedShader, and UserDefinedShader.
void QgsRasterLayer::setContrastEnhancementAlgorithm | ( | QgsContrastEnhancement::ContrastEnhancementAlgorithm | theAlgorithm, |
bool | theGenerateLookupTableFlag = true |
||
) |
Mutator for contrast enhancement algorithm.
Definition at line 2457 of file qgsrasterlayer.cpp.
References mContrastEnhancementAlgorithm, and mContrastEnhancementList.
Referenced by readSymbology(), setContrastEnhancementAlgorithm(), and setDataProvider().
void QgsRasterLayer::setContrastEnhancementAlgorithm | ( | QString | theAlgorithm, |
bool | theGenerateLookupTableFlag = true |
||
) |
Mutator for contrast enhancement algorithm.
Definition at line 2468 of file qgsrasterlayer.cpp.
References QgsContrastEnhancement::ClipToMinimumMaximum, QgsContrastEnhancement::NoEnhancement, QgsDebugMsg, setContrastEnhancementAlgorithm(), QgsContrastEnhancement::StretchAndClipToMinimumMaximum, QgsContrastEnhancement::StretchToMinimumMaximum, and QgsContrastEnhancement::UserDefinedEnhancement.
void QgsRasterLayer::setContrastEnhancementFunction | ( | QgsContrastEnhancementFunction * | theFunction | ) |
Mutator for contrast enhancement function.
Definition at line 2498 of file qgsrasterlayer.cpp.
References mContrastEnhancementList.
void QgsRasterLayer::setDataProvider | ( | const QString & | provider, |
const QStringList & | layers, | ||
const QStringList & | styles, | ||
const QString & | format, | ||
const QString & | crs | ||
) |
Definition at line 2101 of file qgsrasterlayer.cpp.
Referenced by QgsRasterLayer(), readXml(), and update().
void QgsRasterLayer::setDataProvider | ( | const QString & | provider, |
const QStringList & | layers, | ||
const QStringList & | styles, | ||
const QString & | format, | ||
const QString & | crs, | ||
bool | loadDefaultStyleFlag | ||
) |
[ data provider interface ] Set the data provider
Copied from QgsVectorLayer::setDataProvider TODO: Make it work in the raster environment.
Definition at line 2113 of file qgsrasterlayer.cpp.
References QgsRasterDataProvider::addLayers(), QgsRasterDataProvider::ARGBDataType, QgsRasterDataProvider::bandCount(), QgsRasterBandStats::bandName, bandName(), QgsRasterBandStats::bandNumber, QgsRasterDataProvider::capabilities(), QgsRasterDataProvider::colorInterpretation(), ColorLayer, ColorRampShader, QgsRasterBandStats::colorTable, QgsRasterDataProvider::colorTable(), colorTable(), QgsCoordinateReferenceSystem::createFromOgcWmsCrs(), QgsDataProvider::crs(), QgsMapLayer::crs(), QgsRasterDataProvider::dataType(), QgsRasterDataProvider::ExactMinimumMaximum, QgsDataProvider::extent(), QgsRasterDataProvider::generateBandName(), GrayOrUndefined, QgsRasterBandStats::histogramVector, QgsRasterTransparency::initializeTransparentPixelList(), QgsColorRampShader::INTERPOLATED, QgsRasterDataProvider::isNoDataValueValid(), QgsDataProvider::isValid(), QgsCoordinateReferenceSystem::isValid(), lastModified(), loadProvider(), QgsRasterDataProvider::maximumValue(), mBandCount, mBlueBandName, mContrastEnhancementAlgorithm, mContrastEnhancementList, QgsMapLayer::mCRS, mDataProvider, QgsMapLayer::mDataSource, mDrawingStyle, mGrayBandName, mGreenBandName, mHeight, QgsRasterDataProvider::minimumValue(), mLastModified, QgsMapLayer::mLayerExtent, QgsMapLayer::mLayerName, mNoDataValue, mProviderKey, mRasterShader, mRasterStatsList, mRasterTransparency, mRasterType, mRedBandName, mTransparencyBandName, Multiband, MultiBandColor, QgsMapLayer::mValid, mValidNoDataValue, mWidth, QgsMapLayer::name(), QgsRasterDataProvider::noDataValue(), onProgress(), Palette, PalettedColor, QgsRasterDataProvider::PaletteIndex, QgsDebugMsg, QgsRasterShader::rasterShaderFunction(), QgsColorRampShader::setColorRampItemList(), QgsColorRampShader::setColorRampType(), setColorShadingAlgorithm(), setContrastEnhancementAlgorithm(), QgsRasterDataProvider::setImageCrs(), QgsRasterDataProvider::setImageEncoding(), QgsMapLayer::setLayerName(), setMaximumValue(), setMinimumValue(), setNoDataValue(), setStandardDeviations(), QgsCoordinateReferenceSystem::setValidationHint(), QgsRectangle::setXMaximum(), QgsRectangle::setXMinimum(), QgsRectangle::setYMaximum(), QgsRectangle::setYMinimum(), SingleBandColorDataStyle, SingleBandGray, QgsRasterDataProvider::srcDataType(), QgsRasterBandStats::statsGathered, QgsMapLayer::statusChanged(), QgsContrastEnhancement::StretchToMinimumMaximum, QgsRectangle::toString(), QgsCoordinateReferenceSystem::toWkt(), TRSTRING_NOT_SET, QgsCoordinateReferenceSystem::validate(), QgsLogger::warning(), QgsRasterDataProvider::xSize(), and QgsRasterDataProvider::ySize().
void QgsRasterLayer::setDrawingStyle | ( | const DrawingStyle & | theDrawingStyle | ) | [inline] |
Mutator for drawing style.
Definition at line 374 of file qgsrasterlayer.h.
Referenced by readSymbology().
void QgsRasterLayer::setDrawingStyle | ( | const QString & | theDrawingStyleQString | ) |
Overloaded version of the above function for convenience when restoring from xml.
Implemented mainly for serialisation / deserialisation of settings to xml.
Definition at line 2516 of file qgsrasterlayer.cpp.
References mDrawingStyle, MultiBandColor, MultiBandSingleBandGray, MultiBandSingleBandPseudoColor, PalettedColor, PalettedMultiBandColor, PalettedSingleBandGray, PalettedSingleBandPseudoColor, QgsDebugMsg, SingleBandColorDataStyle, SingleBandGray, SingleBandPseudoColor, and UndefinedDrawingStyle.
void QgsRasterLayer::setGrayBandName | ( | const QString & | theBandName | ) |
Mutator for gray band name mapping.
Definition at line 2567 of file qgsrasterlayer.cpp.
References mGrayBandName, and validateBandName().
Referenced by readSymbology().
void QgsRasterLayer::setGrayMinimumMaximumEstimated | ( | bool | theBool | ) | [inline] |
Mutator for mGrayMinimumMaximumEstimated.
Definition at line 377 of file qgsrasterlayer.h.
Referenced by readSymbology().
void QgsRasterLayer::setGreenBandName | ( | const QString & | theBandName | ) |
Mutator for green band name mapping.
Definition at line 2572 of file qgsrasterlayer.cpp.
References mGreenBandName, and validateBandName().
Referenced by readSymbology().
void QgsRasterLayer::setInvertHistogram | ( | bool | theFlag | ) | [inline] |
Mutator to alter the state of the invert histogram flag.
Definition at line 380 of file qgsrasterlayer.h.
Referenced by readSymbology().
void QgsRasterLayer::setLayerOrder | ( | const QStringList & | layers | ) | [virtual] |
Reorders the *previously selected* sublayers of this layer from bottom to top.
(Useful for providers that manage their own layers, such as WMS)
Definition at line 2577 of file qgsrasterlayer.cpp.
References mDataProvider, QgsDebugMsg, and QgsDataProvider::setLayerOrder().
void QgsRasterLayer::setMaximumValue | ( | unsigned int | theBand, |
double | theValue, | ||
bool | theGenerateLookupTableFlag = true |
||
) |
Mutator for setting the maximum value for contrast enhancement.
Definition at line 2589 of file qgsrasterlayer.cpp.
References bandCount(), mContrastEnhancementList, and QgsDebugMsg.
Referenced by drawMultiBandColor(), drawSingleBandGray(), readSymbology(), setDataProvider(), setMaximumValue(), setMinimumMaximumUsingDataset(), and setMinimumMaximumUsingLastExtent().
void QgsRasterLayer::setMaximumValue | ( | QString | theBand, |
double | theValue, | ||
bool | theGenerateLookupTableFlag = true |
||
) |
Mutator for setting the maximum value for contrast enhancement.
Definition at line 2598 of file qgsrasterlayer.cpp.
References bandNumber(), and setMaximumValue().
Sets the minimum and maximum values for the band(s) currently being displayed using the only pixel values from the dataset min/max.
Definition at line 2635 of file qgsrasterlayer.cpp.
References bandNumber(), bandStatistics(), drawingStyle(), grayBandName(), GrayOrUndefined, greenBandName(), QgsRasterBandStats::maximumValue, mGrayBandName, mGreenBandName, QgsRasterBandStats::minimumValue, mRedBandName, Multiband, MultiBandSingleBandGray, rasterType(), redBandName(), setMaximumValue(), setMinimumValue(), setUserDefinedGrayMinimumMaximum(), setUserDefinedRGBMinimumMaximum(), and SingleBandGray.
Sets the minimum and maximum values for the band(s) currently being displayed using the only pixel values from the last/current extent.
Definition at line 2606 of file qgsrasterlayer.cpp.
References blueBandName(), computeMinimumMaximumFromLastExtent(), drawingStyle(), grayBandName(), GrayOrUndefined, greenBandName(), Multiband, MultiBandSingleBandGray, rasterType(), redBandName(), setMaximumValue(), setMinimumValue(), setUserDefinedGrayMinimumMaximum(), setUserDefinedRGBMinimumMaximum(), and SingleBandGray.
void QgsRasterLayer::setMinimumValue | ( | unsigned int | theBand, |
double | theValue, | ||
bool | theGenerateLookupTableFlag = true |
||
) |
Mutator for setting the minimum value for contrast enhancement.
Definition at line 2670 of file qgsrasterlayer.cpp.
References bandCount(), mContrastEnhancementList, and QgsDebugMsg.
Referenced by drawMultiBandColor(), drawSingleBandGray(), readSymbology(), setDataProvider(), setMinimumMaximumUsingDataset(), setMinimumMaximumUsingLastExtent(), and setMinimumValue().
void QgsRasterLayer::setMinimumValue | ( | QString | theBand, |
double | theValue, | ||
bool | theGenerateLookupTableFlag = true |
||
) |
Mutator for setting the minimum value for contrast enhancement.
Definition at line 2679 of file qgsrasterlayer.cpp.
References bandNumber(), and setMinimumValue().
void QgsRasterLayer::setNoDataValue | ( | double | theNoData | ) |
Mutator that allows the NO_DATA entry for this raster to be overridden.
Definition at line 2688 of file qgsrasterlayer.cpp.
References mNoDataValue, mRasterStatsList, and mValidNoDataValue.
Referenced by readSymbology(), resetNoDataValue(), and setDataProvider().
void QgsRasterLayer::setRasterShaderFunction | ( | QgsRasterShaderFunction * | theFunction | ) |
Set the raster shader function to a user defined function.
Definition at line 2704 of file qgsrasterlayer.cpp.
References mColorShadingAlgorithm, mRasterShader, QgsRasterShader::setRasterShaderFunction(), UndefinedShader, and UserDefinedShader.
void QgsRasterLayer::setRedBandName | ( | const QString & | theBandName | ) |
Mutator for red band name (allows alternate mappings e.g.
map blue as red color)
Definition at line 2719 of file qgsrasterlayer.cpp.
References mRedBandName, QgsDebugMsg, and validateBandName().
Referenced by readSymbology().
void QgsRasterLayer::setRGBMinimumMaximumEstimated | ( | bool | theBool | ) | [inline] |
Mutator for mRGBMinimumMaximumEstimated.
Definition at line 383 of file qgsrasterlayer.h.
Referenced by readSymbology().
void QgsRasterLayer::setStandardDeviations | ( | double | theStandardDeviations | ) | [inline] |
Mutator to alter the number of standard deviations that should be plotted.
Definition at line 386 of file qgsrasterlayer.h.
Referenced by readSymbology(), and setDataProvider().
void QgsRasterLayer::setSubLayerVisibility | ( | const QString & | name, |
bool | vis | ||
) | [virtual] |
Set the visibility of the given sublayer name.
Definition at line 2725 of file qgsrasterlayer.cpp.
References mDataProvider, QgsDebugMsg, and QgsDataProvider::setSubLayerVisibility().
void QgsRasterLayer::setTransparentBandName | ( | const QString & | theBandName | ) |
Mutator for transparent band name mapping.
Definition at line 2736 of file qgsrasterlayer.cpp.
References mTransparencyBandName, and validateBandName().
void QgsRasterLayer::setUserDefinedGrayMinimumMaximum | ( | bool | theBool | ) | [inline] |
Mutator for mUserDefinedGrayMinimumMaximum.
Definition at line 389 of file qgsrasterlayer.h.
Referenced by readSymbology(), setMinimumMaximumUsingDataset(), and setMinimumMaximumUsingLastExtent().
void QgsRasterLayer::setUserDefinedRGBMinimumMaximum | ( | bool | theBool | ) | [inline] |
Mutator for mUserDefinedRGBMinimumMaximum.
Definition at line 392 of file qgsrasterlayer.h.
Referenced by readSymbology(), setMinimumMaximumUsingDataset(), and setMinimumMaximumUsingLastExtent().
void QgsRasterLayer::showProgress | ( | int | theValue | ) |
[ data provider interface ] A wrapper function to emit a progress update signal
Definition at line 2741 of file qgsrasterlayer.cpp.
References progressUpdate().
void QgsRasterLayer::showStatusMessage | ( | const QString & | theMessage | ) | [slot] |
Definition at line 2747 of file qgsrasterlayer.cpp.
References QgsMapLayer::statusChanged().
double QgsRasterLayer::standardDeviations | ( | ) | const [inline] |
Accessor to find out how many standard deviations are being plotted.
Definition at line 395 of file qgsrasterlayer.h.
Referenced by writeSymbology().
QStringList QgsRasterLayer::subLayers | ( | ) | const |
Returns the sublayers of this layer - Useful for providers that manage their own layers, such as WMS.
Definition at line 2757 of file qgsrasterlayer.cpp.
References mDataProvider, and QgsRasterDataProvider::subLayers().
Referenced by writeSymbology().
void QgsRasterLayer::thumbnailAsImage | ( | QImage * | thepImage | ) |
Draws a thumbnail of the rasterlayer into the supplied QImage pointer.
Definition at line 2815 of file qgsrasterlayer.cpp.
References QgsRasterViewPort::bottomRightPoint, draw(), QgsRasterViewPort::drawableAreaXDim, QgsRasterViewPort::drawableAreaYDim, mProviderKey, and QgsRasterViewPort::topLeftPoint.
void QgsRasterLayer::thumbnailAsPixmap | ( | QPixmap * | theQPixmap | ) |
Draws a thumbnail of the rasterlayer into the supplied pixmap pointer.
Definition at line 2763 of file qgsrasterlayer.cpp.
References QgsRasterViewPort::bottomRightPoint, draw(), QgsRasterViewPort::drawableAreaXDim, QgsRasterViewPort::drawableAreaYDim, QgsDataProvider::extent(), QgsRectangle::height(), mDataProvider, QgsRasterViewPort::mDestCRS, QgsRasterViewPort::mDrawnExtent, QgsRasterViewPort::mSrcCRS, QgsRasterViewPort::topLeftPoint, and QgsRectangle::width().
virtual QDateTime QgsRasterLayer::timestamp | ( | ) | const [inline, virtual] |
Time stamp of data source in the moment when data/metadata were loaded by provider.
Reimplemented from QgsMapLayer.
Definition at line 651 of file qgsrasterlayer.h.
QString QgsRasterLayer::transparentBandName | ( | ) | const [inline] |
Accessor for transparent band name mapping.
Definition at line 398 of file qgsrasterlayer.h.
void QgsRasterLayer::triggerRepaint | ( | ) |
Emit a signal asking for a repaint.
(inherited from maplayer)
Definition at line 2840 of file qgsrasterlayer.cpp.
References QgsMapLayer::repaintRequested().
bool QgsRasterLayer::update | ( | ) | [private] |
Update the layer if it is outdated.
Definition at line 4516 of file qgsrasterlayer.cpp.
References closeDataProvider(), dataChanged(), QgsRasterDataProvider::dataTimestamp(), init(), mCrs, mDataProvider, mFormat, mLayers, mProviderKey, mStyles, QgsMapLayer::mValid, QgsDebugMsg, setDataProvider(), and QgsRasterDataProvider::timestamp().
Referenced by draw().
void QgsRasterLayer::updateProgress | ( | int | theProgress, |
int | theMax | ||
) | [slot] |
Propagate progress updates from GDAL up to the parent app.
Definition at line 2845 of file qgsrasterlayer.cpp.
References QgsMapLayer::drawingProgress().
bool QgsRasterLayer::usesProvider | ( | ) |
[ data provider interface ] Does this layer use a provider for setting/retrieving data?
Definition at line 4531 of file qgsrasterlayer.cpp.
References mProviderKey.
QString QgsRasterLayer::validateBandName | ( | const QString & | theBandName | ) | [private] |
Verify and transform band name for internal consistency.
Return 'Not Set' on any type of failure
Definition at line 4536 of file qgsrasterlayer.cpp.
References bandName(), QgsRasterDataProvider::generateBandName(), mDataProvider, mRasterStatsList, QgsDebugMsg, QSTRING_NOT_SET, and TRSTRING_NOT_SET.
Referenced by setBlueBandName(), setGrayBandName(), setGreenBandName(), setRedBandName(), and setTransparentBandName().
int QgsRasterLayer::width | ( | ) | [inline] |
Accessor that returns the width of the (unclipped) raster.
Definition at line 404 of file qgsrasterlayer.h.
bool QgsRasterLayer::writeSymbology | ( | QDomNode & | layer_node, |
QDomDocument & | doc, | ||
QString & | errorMessage | ||
) | const [protected, virtual] |
Write the symbology for the layer into the docment provided.
Implements QgsMapLayer.
Definition at line 3180 of file qgsrasterlayer.cpp.
References blueBandName(), ColorRampShader, colorShadingAlgorithm(), colorShadingAlgorithmAsString(), contrastEnhancementAlgorithmAsString(), drawingStyleAsString(), grayBandName(), greenBandName(), hasUserDefinedGrayMinimumMaximum(), hasUserDefinedRGBMinimumMaximum(), QgsRasterDataProvider::imageEncoding(), invertHistogram(), isGrayMinimumMaximumEstimated(), isRGBMinimumMaximumEstimated(), mContrastEnhancementList, mDataProvider, mNoDataValue, mProviderKey, mRasterShader, mRasterTransparency, mValidNoDataValue, QgsDebugMsg, QSTRING_NOT_SET, QgsRasterShader::rasterShaderFunction(), redBandName(), standardDeviations(), subLayers(), QgsDataProvider::subLayerStyles(), QgsRasterTransparency::transparentSingleValuePixelList(), QgsRasterTransparency::transparentThreeValuePixelList(), and TRSTRING_NOT_SET.
Referenced by writeXml().
bool QgsRasterLayer::writeXml | ( | QDomNode & | layer_node, |
QDomDocument & | doc | ||
) | [protected, virtual] |
Write layer specific state to project file Dom node.
Reimplemented from QgsMapLayer.
Definition at line 3506 of file qgsrasterlayer.cpp.
References mProviderKey, QgsLogger::warning(), and writeSymbology().
int QgsRasterLayer::mBandCount [private] |
The number of bands in the dataset.
Definition at line 798 of file qgsrasterlayer.h.
Referenced by bandCount(), init(), and setDataProvider().
QString QgsRasterLayer::mBlueBandName [private] |
The band to be associated with the color blue - usually 3.
Definition at line 801 of file qgsrasterlayer.h.
Referenced by draw(), drawMultiBandColor(), init(), readXml(), setBlueBandName(), and setDataProvider().
The raster shading algorithm being used.
Definition at line 804 of file qgsrasterlayer.h.
Referenced by colorShadingAlgorithmAsString(), init(), legendAsPixmap(), setColorShadingAlgorithm(), and setRasterShaderFunction().
QgsContrastEnhancement::ContrastEnhancementAlgorithm QgsRasterLayer::mContrastEnhancementAlgorithm [private] |
The contrast enhancement algorithm being used.
Definition at line 807 of file qgsrasterlayer.h.
Referenced by contrastEnhancementAlgorithmAsString(), init(), setContrastEnhancementAlgorithm(), and setDataProvider().
List containing the contrast enhancements for each band.
Definition at line 810 of file qgsrasterlayer.h.
Referenced by closeDataProvider(), contrastEnhancement(), maximumValue(), minimumValue(), setContrastEnhancementAlgorithm(), setContrastEnhancementFunction(), setDataProvider(), setMaximumValue(), setMinimumValue(), and writeSymbology().
QString QgsRasterLayer::mCrs [private] |
Definition at line 913 of file qgsrasterlayer.h.
[ data provider interface ] Pointer to data provider derived from the abstract base class QgsDataProvider
Definition at line 816 of file qgsrasterlayer.h.
Referenced by bandStatistics(), buildPyramidList(), buildPyramids(), closeDataProvider(), computeMinimumMaximumEstimates(), computeMinimumMaximumFromLastExtent(), dataProvider(), draw(), drawMultiBandColor(), drawPalettedSingleBandColor(), drawPalettedSingleBandGray(), drawPalettedSingleBandPseudoColor(), drawSingleBandColorData(), drawSingleBandGray(), drawSingleBandPseudoColor(), hasBand(), identify(), identifyAsHtml(), identifyAsText(), legendAsPixmap(), metadata(), paletteAsPixmap(), populateHistogram(), projectionWkt(), rasterUnitsPerPixel(), readColorTable(), readData(), reload(), resetNoDataValue(), setDataProvider(), setLayerOrder(), setSubLayerVisibility(), subLayers(), thumbnailAsPixmap(), update(), validateBandName(), writeSymbology(), and ~QgsRasterLayer().
DrawingStyle QgsRasterLayer::mDrawingStyle [private] |
Definition at line 818 of file qgsrasterlayer.h.
Referenced by draw(), drawingStyleAsString(), init(), legendAsPixmap(), readXml(), setDataProvider(), and setDrawingStyle().
bool QgsRasterLayer::mEditable [private] |
[ data provider interface ] Flag indicating whether the layer is in editing mode or not
Definition at line 821 of file qgsrasterlayer.h.
QString QgsRasterLayer::mError [private] |
[ data provider interface ]The error message associated with the last error
Definition at line 824 of file qgsrasterlayer.h.
Referenced by lastError().
QString QgsRasterLayer::mErrorCaption [private] |
[ data provider interface ] The error caption associated with the last error
Definition at line 827 of file qgsrasterlayer.h.
Referenced by lastErrorTitle().
QString QgsRasterLayer::mFormat [private] |
Definition at line 912 of file qgsrasterlayer.h.
double QgsRasterLayer::mGeoTransform[6] [private] |
Pointer to the gdaldataset.
Pointer to the gdaldataset (possibly warped vrt) Values for mapping pixel to world coordinates. Contents of this array are the same as the GDAL adfGeoTransform
Definition at line 836 of file qgsrasterlayer.h.
Referenced by drawMultiBandColor(), drawPalettedSingleBandColor(), drawPalettedSingleBandGray(), drawPalettedSingleBandPseudoColor(), drawSingleBandColorData(), drawSingleBandGray(), drawSingleBandPseudoColor(), and init().
QString QgsRasterLayer::mGrayBandName [private] |
The band to be associated with the grayscale only output - usually 1.
Definition at line 839 of file qgsrasterlayer.h.
Referenced by draw(), init(), readSymbology(), readXml(), setDataProvider(), setGrayBandName(), and setMinimumMaximumUsingDataset().
bool QgsRasterLayer::mGrayMinimumMaximumEstimated [private] |
Flag to indicate of the min max values are actual or estimates/user defined.
Definition at line 842 of file qgsrasterlayer.h.
Referenced by drawSingleBandGray(), and init().
QString QgsRasterLayer::mGreenBandName [private] |
The band to be associated with the color green - usually 2.
Definition at line 845 of file qgsrasterlayer.h.
Referenced by draw(), drawMultiBandColor(), init(), readSymbology(), readXml(), setDataProvider(), setGreenBandName(), and setMinimumMaximumUsingDataset().
bool QgsRasterLayer::mHasPyramids [private] |
Whether this raster has overviews / pyramids or not.
Definition at line 848 of file qgsrasterlayer.h.
Referenced by closeDataProvider(), init(), and legendAsPixmap().
int QgsRasterLayer::mHeight [private] |
Raster height.
Definition at line 854 of file qgsrasterlayer.h.
Referenced by bandStatistics(), draw(), and setDataProvider().
bool QgsRasterLayer::mInvertColor [private] |
Flag indicating whether the color of pixels should be inverted or not.
Definition at line 857 of file qgsrasterlayer.h.
Referenced by drawMultiBandColor(), drawPalettedSingleBandColor(), drawPalettedSingleBandGray(), drawPalettedSingleBandPseudoColor(), drawSingleBandGray(), drawSingleBandPseudoColor(), and legendAsPixmap().
QDateTime QgsRasterLayer::mLastModified [private] |
[ data provider interface ] Timestamp, the last modified time of the data source when the layer was created
Definition at line 860 of file qgsrasterlayer.h.
Referenced by setDataProvider().
Definition at line 862 of file qgsrasterlayer.h.
Referenced by computeMinimumMaximumFromLastExtent(), draw(), and init().
QStringList QgsRasterLayer::mLayers [private] |
WMS parameters.
Definition at line 910 of file qgsrasterlayer.h.
bool QgsRasterLayer::mModified [private] |
[ data provider interface ] pointer for loading the provider library
[ data provider interface ] Flag indicating whether the layer has been modified since the last commit
Definition at line 868 of file qgsrasterlayer.h.
double QgsRasterLayer::mNoDataValue [private] |
Cell value representing no data.
e.g. -9999
Definition at line 871 of file qgsrasterlayer.h.
Referenced by computeMinimumMaximumFromLastExtent(), drawMultiBandColor(), drawPalettedSingleBandColor(), drawPalettedSingleBandGray(), drawPalettedSingleBandPseudoColor(), drawSingleBandGray(), drawSingleBandPseudoColor(), init(), metadata(), readSymbology(), readValue(), resetNoDataValue(), setDataProvider(), setNoDataValue(), and writeSymbology().
QString QgsRasterLayer::mProviderKey [private] |
[ data provider interface ] Data provider key
Definition at line 874 of file qgsrasterlayer.h.
Referenced by identify(), identifyAsHtml(), identifyAsText(), legendAsPixmap(), paletteAsPixmap(), providerKey(), readXml(), setDataProvider(), thumbnailAsImage(), update(), usesProvider(), writeSymbology(), and writeXml().
This list holds a series of RasterPyramid structs which store information for each potential pyramid level.
Definition at line 877 of file qgsrasterlayer.h.
Referenced by closeDataProvider().
QgsRasterShader* QgsRasterLayer::mRasterShader [private] |
The raster shader for the layer.
Definition at line 880 of file qgsrasterlayer.h.
Referenced by closeDataProvider(), drawPalettedSingleBandColor(), drawPalettedSingleBandGray(), drawPalettedSingleBandPseudoColor(), drawSingleBandPseudoColor(), init(), readSymbology(), setColorShadingAlgorithm(), setDataProvider(), setRasterShaderFunction(), writeSymbology(), and ~QgsRasterLayer().
A collection of stats - one for each band in the layer.
Definition at line 883 of file qgsrasterlayer.h.
Referenced by bandName(), bandNumber(), bandStatistics(), closeDataProvider(), colorTable(), hasStatistics(), setDataProvider(), setNoDataValue(), and validateBandName().
The transparency container.
Definition at line 886 of file qgsrasterlayer.h.
Referenced by drawMultiBandColor(), drawPalettedSingleBandColor(), drawPalettedSingleBandGray(), drawPalettedSingleBandPseudoColor(), drawSingleBandGray(), drawSingleBandPseudoColor(), readSymbology(), setDataProvider(), and writeSymbology().
LayerType QgsRasterLayer::mRasterType [private] |
Definition at line 888 of file qgsrasterlayer.h.
Referenced by bandStatistics(), init(), and setDataProvider().
QString QgsRasterLayer::mRedBandName [private] |
The band to be associated with the color red - usually 1.
Definition at line 891 of file qgsrasterlayer.h.
Referenced by draw(), drawMultiBandColor(), init(), readSymbology(), readXml(), setDataProvider(), setMinimumMaximumUsingDataset(), and setRedBandName().
bool QgsRasterLayer::mRGBMinimumMaximumEstimated [private] |
Flag to indicate of the min max values are actual or estimates/user defined.
Definition at line 894 of file qgsrasterlayer.h.
Referenced by drawMultiBandColor(), and init().
double QgsRasterLayer::mStandardDeviations [private] |
Number of stddev to plot (0) to ignore.
Not applicable to all layer types
Definition at line 813 of file qgsrasterlayer.h.
Referenced by drawMultiBandColor(), drawPalettedSingleBandPseudoColor(), drawSingleBandGray(), and drawSingleBandPseudoColor().
QStringList QgsRasterLayer::mStyles [private] |
Definition at line 911 of file qgsrasterlayer.h.
QString QgsRasterLayer::mTransparencyBandName [private] |
The band to be associated with transparency.
Definition at line 897 of file qgsrasterlayer.h.
Referenced by drawMultiBandColor(), drawPalettedSingleBandColor(), drawPalettedSingleBandGray(), drawPalettedSingleBandPseudoColor(), drawSingleBandGray(), drawSingleBandPseudoColor(), init(), setDataProvider(), and setTransparentBandName().
bool QgsRasterLayer::mUserDefinedGrayMinimumMaximum [private] |
Flag to indicate if the user entered custom min max values.
Definition at line 900 of file qgsrasterlayer.h.
Referenced by drawSingleBandGray(), and init().
bool QgsRasterLayer::mUserDefinedRGBMinimumMaximum [private] |
Flag to indicate if the user entered custom min max values.
Definition at line 903 of file qgsrasterlayer.h.
Referenced by drawMultiBandColor(), and init().
bool QgsRasterLayer::mValidNoDataValue [private] |
Flag indicating if the nodatavalue is valid.
Definition at line 906 of file qgsrasterlayer.h.
Referenced by computeMinimumMaximumFromLastExtent(), drawMultiBandColor(), drawPalettedSingleBandColor(), drawPalettedSingleBandGray(), drawPalettedSingleBandPseudoColor(), drawSingleBandGray(), drawSingleBandPseudoColor(), init(), metadata(), readSymbology(), readValue(), resetNoDataValue(), setDataProvider(), setNoDataValue(), and writeSymbology().
int QgsRasterLayer::mWidth [private] |
Raster width.
Definition at line 851 of file qgsrasterlayer.h.
Referenced by draw(), and setDataProvider().
const QString QgsRasterLayer::QSTRING_NOT_SET [private] |
Constant defining flag for XML and a constant that signals property not used.
Definition at line 794 of file qgsrasterlayer.h.
Referenced by validateBandName(), and writeSymbology().
const QString QgsRasterLayer::TRSTRING_NOT_SET [private] |
Definition at line 795 of file qgsrasterlayer.h.
Referenced by draw(), init(), readXml(), setDataProvider(), validateBandName(), and writeSymbology().