QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
17 #ifndef QGSVIRTUALLAYERDEFINITION_H
18 #define QGSVIRTUALLAYERDEFINITION_H
20 #include "qgis_core.h"
49 SourceLayer(
const QString &name,
const QString &source,
const QString &provider,
const QString &encoding )
52 , mProvider( provider )
53 , mEncoding( encoding )
63 QString
name()
const {
return mName; }
69 QString
source()
const {
return mSource; }
106 QString toString()
const;
109 void addSource(
const QString &name,
const QString &ref );
112 void addSource(
const QString &name,
const QString &source,
const QString &provider,
const QString &encoding =
"" );
121 QString
query()
const {
return mQuery; }
123 void setQuery(
const QString &query ) { mQuery = query; }
128 void setFilePath(
const QString &filePath ) { mFilePath = filePath; }
131 QString
uid()
const {
return mUid; }
133 void setUid(
const QString &uid ) { mUid = uid; }
178 bool hasSourceLayer(
const QString &name )
const;
181 bool hasReferencedLayers()
const;
193 QString subsetString()
const;
199 void setSubsetString(
const QString &subsetString );
202 SourceLayers mSourceLayers;
205 QString mGeometryField;
210 long mGeometrySrid = 0;
211 QString mSubsetString;
void setGeometryWkbType(QgsWkbTypes::Type t)
Sets the type of the geometry.
QString source() const
The source url used by the provider to build the layer.
void setGeometrySrid(long srid)
Sets the SRID of the geometry.
void setQuery(const QString &query)
Sets the SQL query.
QString geometryField() const
Gets the name of the geometry field. Empty if no geometry field.
void setLazy(bool lazy)
Sets the lazy mode.
SourceLayer(const QString &name, const QString &source, const QString &provider, const QString &encoding)
Constructor variant to build a layer with a provider and a source.
void setUid(const QString &uid)
Sets the name of the field with unique identifiers.
QString reference() const
The reference (id) of the live layer.
bool isReferenced() const
Is it a live layer or not ?
QString encoding() const
Optional encoding for the provider.
Container of fields for a vector layer.
const QgsVirtualLayerDefinition::SourceLayers & sourceLayers() const
Gets access to the source layers.
A SourceLayer is either a reference to a live layer in the registry or all the parameters needed to l...
Type
The WKB type describes the number of dimensions a geometry has.
long geometrySrid() const
Gets the SRID of the geometry.
QList< QgsVirtualLayerDefinition::SourceLayer > SourceLayers
List of source layers.
void setFields(const QgsFields &fields)
Sets field definitions.
void setGeometryField(const QString &geometryField)
Sets the name of the geometry field.
QString uid() const
Gets the name of the field with unique identifiers.
bool isLazy() const
Returns the lazy mode.
QString query() const
Gets the SQL query.
void setFilePath(const QString &filePath)
Sets the file path.
Class to manipulate the definition of a virtual layer.
bool hasDefinedGeometry() const
Convenient method to test if the geometry is defined (not NoGeometry and not Unknown)
SourceLayer(const QString &name, const QString &ref)
Constructor variant to build a live layer reference.
QString provider() const
Provider key.
QgsWkbTypes::Type geometryWkbType() const
Gets the type of the geometry QgsWkbTypes::NoGeometry to hide any geometry QgsWkbTypes::Unknown for u...
QgsFields fields() const
Gets field definitions.
QString name() const
Name of the layer.
QString filePath() const
Gets the file path. May be empty.