Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso authored and nyalldawson committed Nov 8, 2022
1 parent 45552a6 commit 8e0a5e1
Show file tree
Hide file tree
Showing 27 changed files with 467 additions and 409 deletions.
6 changes: 3 additions & 3 deletions python/core/auto_additions/qgis.py
Expand Up @@ -733,14 +733,14 @@
Qgis.RasterAttributeTableFieldUsage.GreenMax.__doc__ = "Field usage GreenMax"
Qgis.RasterAttributeTableFieldUsage.BlueMax.__doc__ = "Field usage BlueMax"
Qgis.RasterAttributeTableFieldUsage.AlphaMax.__doc__ = "Field usage AlphaMax"
Qgis.RasterAttributeTableFieldUsage.MaxCount.__doc__ = "Field usage MaxCount"
Qgis.RasterAttributeTableFieldUsage.__doc__ = 'The RasterAttributeTableFieldUsage enum represents the usage of a Raster Attribute Table field.\n\n.. versionadded:: 3.30\n\n' + '* ``Generic``: ' + Qgis.RasterAttributeTableFieldUsage.Generic.__doc__ + '\n' + '* ``PixelCount``: ' + Qgis.RasterAttributeTableFieldUsage.PixelCount.__doc__ + '\n' + '* ``Name``: ' + Qgis.RasterAttributeTableFieldUsage.Name.__doc__ + '\n' + '* ``Min``: ' + Qgis.RasterAttributeTableFieldUsage.Min.__doc__ + '\n' + '* ``Max``: ' + Qgis.RasterAttributeTableFieldUsage.Max.__doc__ + '\n' + '* ``MinMax``: ' + Qgis.RasterAttributeTableFieldUsage.MinMax.__doc__ + '\n' + '* ``Red``: ' + Qgis.RasterAttributeTableFieldUsage.Red.__doc__ + '\n' + '* ``Green``: ' + Qgis.RasterAttributeTableFieldUsage.Green.__doc__ + '\n' + '* ``Blue``: ' + Qgis.RasterAttributeTableFieldUsage.Blue.__doc__ + '\n' + '* ``Alpha``: ' + Qgis.RasterAttributeTableFieldUsage.Alpha.__doc__ + '\n' + '* ``RedMin``: ' + Qgis.RasterAttributeTableFieldUsage.RedMin.__doc__ + '\n' + '* ``GreenMin``: ' + Qgis.RasterAttributeTableFieldUsage.GreenMin.__doc__ + '\n' + '* ``BlueMin``: ' + Qgis.RasterAttributeTableFieldUsage.BlueMin.__doc__ + '\n' + '* ``AlphaMin``: ' + Qgis.RasterAttributeTableFieldUsage.AlphaMin.__doc__ + '\n' + '* ``RedMax``: ' + Qgis.RasterAttributeTableFieldUsage.RedMax.__doc__ + '\n' + '* ``GreenMax``: ' + Qgis.RasterAttributeTableFieldUsage.GreenMax.__doc__ + '\n' + '* ``BlueMax``: ' + Qgis.RasterAttributeTableFieldUsage.BlueMax.__doc__ + '\n' + '* ``AlphaMax``: ' + Qgis.RasterAttributeTableFieldUsage.AlphaMax.__doc__ + '\n' + '* ``MaxCount``: ' + Qgis.RasterAttributeTableFieldUsage.MaxCount.__doc__
Qgis.RasterAttributeTableFieldUsage.MaxCount.__doc__ = "Not used by QGIS: GDAL Maximum GFU value (equals to GFU_AlphaMax+1 currently)"
Qgis.RasterAttributeTableFieldUsage.__doc__ = 'The RasterAttributeTableFieldUsage enum represents the usage of a Raster Attribute Table field.\n\n.. note::\n\n Directly mapped from GDALRATFieldUsage enum values.\n\n.. versionadded:: 3.30\n\n' + '* ``Generic``: ' + Qgis.RasterAttributeTableFieldUsage.Generic.__doc__ + '\n' + '* ``PixelCount``: ' + Qgis.RasterAttributeTableFieldUsage.PixelCount.__doc__ + '\n' + '* ``Name``: ' + Qgis.RasterAttributeTableFieldUsage.Name.__doc__ + '\n' + '* ``Min``: ' + Qgis.RasterAttributeTableFieldUsage.Min.__doc__ + '\n' + '* ``Max``: ' + Qgis.RasterAttributeTableFieldUsage.Max.__doc__ + '\n' + '* ``MinMax``: ' + Qgis.RasterAttributeTableFieldUsage.MinMax.__doc__ + '\n' + '* ``Red``: ' + Qgis.RasterAttributeTableFieldUsage.Red.__doc__ + '\n' + '* ``Green``: ' + Qgis.RasterAttributeTableFieldUsage.Green.__doc__ + '\n' + '* ``Blue``: ' + Qgis.RasterAttributeTableFieldUsage.Blue.__doc__ + '\n' + '* ``Alpha``: ' + Qgis.RasterAttributeTableFieldUsage.Alpha.__doc__ + '\n' + '* ``RedMin``: ' + Qgis.RasterAttributeTableFieldUsage.RedMin.__doc__ + '\n' + '* ``GreenMin``: ' + Qgis.RasterAttributeTableFieldUsage.GreenMin.__doc__ + '\n' + '* ``BlueMin``: ' + Qgis.RasterAttributeTableFieldUsage.BlueMin.__doc__ + '\n' + '* ``AlphaMin``: ' + Qgis.RasterAttributeTableFieldUsage.AlphaMin.__doc__ + '\n' + '* ``RedMax``: ' + Qgis.RasterAttributeTableFieldUsage.RedMax.__doc__ + '\n' + '* ``GreenMax``: ' + Qgis.RasterAttributeTableFieldUsage.GreenMax.__doc__ + '\n' + '* ``BlueMax``: ' + Qgis.RasterAttributeTableFieldUsage.BlueMax.__doc__ + '\n' + '* ``AlphaMax``: ' + Qgis.RasterAttributeTableFieldUsage.AlphaMax.__doc__ + '\n' + '* ``MaxCount``: ' + Qgis.RasterAttributeTableFieldUsage.MaxCount.__doc__
# --
Qgis.RasterAttributeTableFieldUsage.baseClass = Qgis
# monkey patching scoped based enum
Qgis.RasterAttributeTableType.Thematic.__doc__ = ""
Qgis.RasterAttributeTableType.Athematic.__doc__ = ""
Qgis.RasterAttributeTableType.__doc__ = 'The RasterAttributeTableType enum represents the type of RAT.\n\n.. versionadded:: 3.30\n\n' + '* ``Thematic``: ' + Qgis.RasterAttributeTableType.Thematic.__doc__ + '\n' + '* ``Athematic``: ' + Qgis.RasterAttributeTableType.Athematic.__doc__
Qgis.RasterAttributeTableType.__doc__ = 'The RasterAttributeTableType enum represents the type of RAT.\nnote Directly mapped from GDALRATTableType enum values.\n\n.. versionadded:: 3.30\n\n' + '* ``Thematic``: ' + Qgis.RasterAttributeTableType.Thematic.__doc__ + '\n' + '* ``Athematic``: ' + Qgis.RasterAttributeTableType.Athematic.__doc__
# --
Qgis.RasterAttributeTableType.baseClass = Qgis
# monkey patching scoped based enum
Expand Down
27 changes: 19 additions & 8 deletions python/core/auto_generated/raster/qgspalettedrasterrenderer.sip.in
Expand Up @@ -35,18 +35,29 @@ Constructor for Class
QString label;
};

struct MultiValueClass
{
MultiValueClass( QVector< double > values, const QColor &color = QColor(), const QString &label = QString() );
class MultiValueClass
{
%Docstring(signature="appended")
Properties of a multi value class: a class that contains multiple values.

.. versionadded:: 3.30
%End

%TypeHeaderCode
#include "qgspalettedrasterrenderer.h"
%End
public:

MultiValueClass( const QVector< QVariant > &values, const QColor &color = QColor(), const QString &label = QString() );
%Docstring
Constructor for Class
Constructor for MultiValueClass from a list of values
%End

QVector< double > values;
QVector< QVariant > values;

QColor color;
QColor color;

QString label;
QString label;
};


Expand Down Expand Up @@ -160,7 +171,7 @@ Converts a raster color ``table`` to paletted renderer class data.
.. versionadded:: 3.0
%End

static QgsPalettedRasterRenderer::MultiValueClassData rasterAttributeTableToClassData( const QgsRasterAttributeTable *attributeTable, const int classificationColumn = -1, QgsColorRamp *ramp = 0 );
static QgsPalettedRasterRenderer::MultiValueClassData rasterAttributeTableToClassData( const QgsRasterAttributeTable *attributeTable, int classificationColumn = -1, QgsColorRamp *ramp = 0 );
%Docstring
Reads and returns classes from the Raster Attribute Table ``attributeTable``, optionally classifying the attribute table
by ``classificationColumn`` and setting the colors from ``ramp``.
Expand Down
92 changes: 64 additions & 28 deletions python/core/auto_generated/raster/qgsrasterattributetable.sip.in
Expand Up @@ -25,46 +25,79 @@ methods to handle data from QGIS and to import/export a Raster Attribute Table f
%End
public:

struct UsageInformation
{
QString description; //! Usage description
bool unique; //! Usage must be unique
bool required; //! Usage is required
bool isColor; //! Usage is part of a color component
bool isRamp; //! Usage is part of a ramp component
bool supported; //! Usage is supported
bool maybeClass; //! May be suitable for classification
QList<QVariant::Type> allowedTypes; //! Usage allowed types
class UsageInformation
{
%Docstring(signature="appended")
The UsageInformation struct represents information about a field usage.
%End

%TypeHeaderCode
#include "qgsrasterattributetable.h"
%End
public:

QString description;

bool unique;

bool required;

bool isColor;

bool isRamp;

bool supported;

bool maybeClass;

QList<QVariant::Type> allowedTypes;
};

struct Field
{
class Field
{
%Docstring(signature="appended")
The Field struct represents a Raster Attribute Table field, including its name, usage and type.
%End

%TypeHeaderCode
#include "qgsrasterattributetable.h"
%End
public:

Field( const QString &name, const Qgis::RasterAttributeTableFieldUsage &usage, const QVariant::Type type );
Field( const QString &name, const Qgis::RasterAttributeTableFieldUsage &usage, const QVariant::Type type );
%Docstring
Creates a new Field with ``name``, ``type`` and ``usage``.
%End

bool isColor( ) const;
bool isColor( ) const;
%Docstring
Returns ``True`` if the field carries a color component (Red, Green, Blue and optionally Alpha) information.
%End

bool isRamp( ) const;
bool isRamp( ) const;
%Docstring
Returns ``True`` if the field carries a color ramp component information (RedMin/RedMax, GreenMin/GreenMax, BlueMin/BlueMax and optionally AlphaMin/AlphaMax) information.
%End

QString name;
Qgis::RasterAttributeTableFieldUsage usage;
QVariant::Type type;
QString name;
Qgis::RasterAttributeTableFieldUsage usage;
QVariant::Type type;
};

struct MinMaxClass
{
QString name;
QVector< double > minMaxValues;
QColor color;
class MinMaxClass
{
%Docstring(signature="appended")
The Field struct represents a Raster Attribute Table classification entry for a thematic Raster Attribute Table.
%End

%TypeHeaderCode
#include "qgsrasterattributetable.h"
%End
public:
QString name;

QVector< double > minMaxValues;
QColor color;
};

Qgis::RasterAttributeTableType type() const;
Expand Down Expand Up @@ -317,12 +350,12 @@ Sets the ``value`` for ``row`` and ``column``.
Returns the ``value`` for ``row`` and ``column``.
%End

double minValue( ) const;
double minimumValue( ) const;
%Docstring
Returns the minimum value of the MinMax (thematic) or Min (athematic) column, returns NaN on errors.
%End

double maxValue( ) const;
double maximumValue( ) const;
%Docstring
Returns the maximum value of the MinMax (thematic) or Max (athematic) column, returns NaN on errors.
%End
Expand Down Expand Up @@ -374,7 +407,7 @@ the current data are returned without any change.
Try to determine the field usage from its ``name`` and ``type``.
%End

const QString &filePath() const;
QString filePath() const;
%Docstring
Returns the (possibly empty) path of the file-based RAT, the path is set when a RAT is read or written from/to a file.

Expand All @@ -397,9 +430,12 @@ Returns the list of field usages for colors and values.

static QgsRasterAttributeTable *createFromRaster( QgsRasterLayer *rasterLayer, int *bandNumber /Out/ = 0 ) /Factory/;
%Docstring
Creates a new Raster Attribute Table from a ``rasterLayer``, the renderer must be Paletted or SingleBandPseudoColor, optionally reporting in ``bandNumber`` the raster band from which the attribute table was created.
Creates a new Raster Attribute Table from a raster layer, the renderer must be Paletted or SingleBandPseudoColor, optionally reporting the raster band from which the attribute table was created.

:param rasterLayer: raster layer

:return: NULL in case of errors or unsupported renderer.
:return: - NULL in case of errors or unsupported renderer.
- bandNumber: band number
%End


Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 8e0a5e1

Please sign in to comment.