mirror of
https://github.com/qgis/QGIS.git
synced 2025-11-22 00:14:55 -05:00
149 lines
4.6 KiB
Plaintext
149 lines
4.6 KiB
Plaintext
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/core/raster/qgsrasterattributetable.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|
|
|
|
|
|
|
|
class QgsRasterAttributeTable
|
|
{
|
|
%Docstring(signature="appended")
|
|
The :py:class:`QgsRasterAttributeTable` class represents a raster attribute table (RAT).
|
|
|
|
This class is modeled after the GDAL RAT implementation, it adds some convenience
|
|
methods to handle data from QGIS and to import/export a RAT from/to a DBF VAT file.
|
|
|
|
.. versionadded:: 3.30
|
|
%End
|
|
|
|
%TypeHeaderCode
|
|
#include "qgsrasterattributetable.h"
|
|
%End
|
|
public:
|
|
|
|
|
|
struct Field
|
|
{
|
|
|
|
Field( const QString &name, const Qgis::RasterAttributeTableFieldUsage &usage, const QVariant::Type type );
|
|
%Docstring
|
|
Creates a new Field with ``name``, ``type`` and ``usage``.
|
|
%End
|
|
QString name;
|
|
Qgis::RasterAttributeTableFieldUsage usage;
|
|
QVariant::Type type;
|
|
};
|
|
|
|
Qgis::RasterAttributeTableType type() const;
|
|
%Docstring
|
|
Returns the RAT type.
|
|
%End
|
|
|
|
void setType( const Qgis::RasterAttributeTableType type );
|
|
%Docstring
|
|
Sets the RAT ``type``
|
|
%End
|
|
|
|
bool hasColor();
|
|
%Docstring
|
|
Returns ``True`` if the RAT has RGB information.
|
|
%End
|
|
|
|
QList<QgsRasterAttributeTable::Field> fields() const;
|
|
%Docstring
|
|
Returns the RAT fields.
|
|
%End
|
|
|
|
QgsFields qgisFields() const;
|
|
%Docstring
|
|
Returns the RAT fields as :py:class:`QgsFields`.
|
|
%End
|
|
|
|
QgsFeatureList qgisFeatures( ) const;
|
|
%Docstring
|
|
Returns the RAT rows as a list of :py:class:`QgsFeature`.
|
|
%End
|
|
|
|
bool isDirty() const;
|
|
%Docstring
|
|
Returns ``True`` if the RAT was modified from its last reading from the storage.
|
|
%End
|
|
|
|
void setIsDirty( bool isDirty );
|
|
%Docstring
|
|
Sets the RAT dirty state to ``isDirty``;
|
|
%End
|
|
|
|
bool isValid() const;
|
|
%Docstring
|
|
Returns ``True`` if the RAT is valid.
|
|
%End
|
|
|
|
bool insertField( const QgsRasterAttributeTable::Field &field, int position = 0 );
|
|
%Docstring
|
|
Inserts a new ``field`` at ``position`` and returns ``True`` on success.
|
|
%End
|
|
|
|
bool insertField( const QString &name, Qgis::RasterAttributeTableFieldUsage usage, QVariant::Type type, int position = 0 );
|
|
%Docstring
|
|
Creates a new field from ``name``, ``usage`` and ``type`` and inserts it at ``position``, returns ``True`` on success.
|
|
%End
|
|
|
|
bool appendField( const QString &name, Qgis::RasterAttributeTableFieldUsage usage, QVariant::Type type );
|
|
%Docstring
|
|
Creates a new field from ``name``, ``usage`` and ``type`` and appends it to the fields, returns ``True`` on success.
|
|
%End
|
|
|
|
bool appendField( const QgsRasterAttributeTable::Field &field );
|
|
%Docstring
|
|
Appends a new ``field`` and returns ``True`` on success.
|
|
%End
|
|
|
|
bool removeField( const QString &name );
|
|
%Docstring
|
|
Removes the field with ``name``, returns ``True`` on success.
|
|
%End
|
|
|
|
bool insertRow( const QVariantList data, int position = 0 );
|
|
%Docstring
|
|
Inserts a row of ``data`` in the RAT at ``position``, returns ``True`` on success.
|
|
%End
|
|
|
|
bool appendRow( const QVariantList data );
|
|
%Docstring
|
|
Appends a row of ``data`` to the RAT, returns ``True`` on success.
|
|
%End
|
|
|
|
bool writeToFile( const QString &path, QString *errorMessage /Out/ = 0 );
|
|
%Docstring
|
|
Writes the RAT to a DBF file specified by ``path``, optionally reporting any error in ``errorMessage``, returns ``True`` on success.
|
|
%End
|
|
|
|
bool readFromFile( const QString &path, QString *errorMessage /Out/ = 0 );
|
|
%Docstring
|
|
Reads the RAT from a DBF file specified by ``path``, optionally reporting any error in ``errorMessage``, returns ``True`` on success.
|
|
%End
|
|
|
|
const QList<QList<QVariant>> data() const;
|
|
%Docstring
|
|
Returns the RAT rows.
|
|
%End
|
|
|
|
static Qgis::RasterAttributeTableFieldUsage guessFieldUsage( const QString &name, const QVariant::Type type );
|
|
%Docstring
|
|
Try to determine the field usage from its ``name`` and ``type``.
|
|
%End
|
|
|
|
};
|
|
|
|
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/core/raster/qgsrasterattributetable.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|