QGIS API Documentation
3.18.1-Zürich (202f1bf7e5)
|
Setting options for loading vector layers. More...
#include <qgsvectorlayer.h>
Public Member Functions | |
LayerOptions (bool loadDefaultStyle=true, bool readExtentFromXml=false) | |
Constructor for LayerOptions. More... | |
LayerOptions (const QgsCoordinateTransformContext &transformContext, bool loadDefaultStyle=true, bool readExtentFromXml=false) | |
Constructor for LayerOptions. More... | |
Public Attributes | |
QgsCoordinateReferenceSystem | fallbackCrs |
Fallback layer coordinate reference system. More... | |
QgsWkbTypes::Type | fallbackWkbType = QgsWkbTypes::Unknown |
Fallback geometry type. More... | |
bool | loadDefaultStyle = true |
Set to true if the default layer style should be loaded. More... | |
bool | readExtentFromXml = false |
If true , the layer extent will be read from XML (i.e. More... | |
bool | skipCrsValidation = false |
Controls whether the layer is allowed to have an invalid/unknown CRS. More... | |
QgsCoordinateTransformContext | transformContext = QgsCoordinateTransformContext() |
Coordinate transform context. More... | |
Setting options for loading vector layers.
Definition at line 425 of file qgsvectorlayer.h.
|
inlineexplicit |
Constructor for LayerOptions.
Definition at line 431 of file qgsvectorlayer.h.
|
inlineexplicit |
QgsCoordinateReferenceSystem QgsVectorLayer::LayerOptions::fallbackCrs |
Fallback layer coordinate reference system.
This may be set for layers where the coordinate reference system is known in advance, and where the layer path may not be initially resolvable. (E.g. layers with a URI pointing to a non-existent file). It is only ever used if the layer cannot be resolved, otherwise the actual layer CRS will be detected and used for the layer.
Definition at line 489 of file qgsvectorlayer.h.
QgsWkbTypes::Type QgsVectorLayer::LayerOptions::fallbackWkbType = QgsWkbTypes::Unknown |
Fallback geometry type.
This may be set for layers where the geometry type is known in advance, and where the layer path may not be initially resolvable. (E.g. layers with a URI pointing to a non-existent file). It is only ever used if the layer cannot be resolved, otherwise the actual layer geometry type will be detected and used for the layer.
Definition at line 476 of file qgsvectorlayer.h.
bool QgsVectorLayer::LayerOptions::loadDefaultStyle = true |
Set to true
if the default layer style should be loaded.
Definition at line 451 of file qgsvectorlayer.h.
bool QgsVectorLayer::LayerOptions::readExtentFromXml = false |
If true
, the layer extent will be read from XML (i.e.
stored in the project file). If false
, the extent will be determined by the provider on layer load.
Definition at line 457 of file qgsvectorlayer.h.
bool QgsVectorLayer::LayerOptions::skipCrsValidation = false |
Controls whether the layer is allowed to have an invalid/unknown CRS.
If true
, then no validation will be performed on the layer's CRS and the layer layer's crs() may be invalid() (i.e. the layer will have no georeferencing available and will be treated as having purely numerical coordinates).
If false
(the default), the layer's CRS will be validated using QgsCoordinateReferenceSystem::validate(), which may cause a blocking, user-facing dialog asking users to manually select the correct CRS for the layer.
Definition at line 504 of file qgsvectorlayer.h.
QgsCoordinateTransformContext QgsVectorLayer::LayerOptions::transformContext = QgsCoordinateTransformContext() |