API¶
The following modules are included within this Plugin. The Plugin’s repository is on GitHub.
modelVectorLayers module¶
Creates vector layers with a QGIS memory layer data source. These layers are intended to demonstrate how the Geometry Attribute Table plugin renders datasets that have: multi-part, single part, empty, and, null geometries. A description of the created layer is included with each method.
-
modelVectorLayers.
createMultiLines
(layerName='Multi-Part Lines')¶ A geometry collection of multi-part lines and lines (single part constrained).
- Args:
- layerName (str): The name of the layer that is loaded into QGIS.
- Returns:
- A memory vector layer containing features with the following geometries: 2 part multi-line; 3 part multi-line, 1 part multi-line, line, Empty multi-line, and, Null.
-
modelVectorLayers.
createMultiPoints
(layerName='Multi-Part Points')¶ A geometry collection of multi-part points and points (single part constrained).
For an empty point, QGIS creates erroneously creates a point with the coordinates (0 0).
- Args:
- layerName (str): The name of the layer that is loaded into QGIS.
- Returns:
- A QGIS memory data source vector layer containing features with the following geometries: 2 point multi-point; 4 point multi-point, 1 point multi-point, point, empty multi-point, and, null.
parseQGISGeometry module¶
The parseQGISGeometry module includes a QGIS expression called geometryField that returns a string that represents a vector feature’s geometry. The geometryField QGIS expression is described in detail in the section Geometry Describing Expression.
The QGIS Expression and methods in this module parse each record’s vector geometry for a QGIS vector layer.
-
parseQGISGeometry.
layerAddVirtualGeometryField
(vectorLayer)¶ Appends a virtual field called “Geometry” to the input vectorLayer. This virtual field consists of string values populated by the “geometryField” expression that is contained within this module.
- Args:
- vectorLayer (QgsVectorLayer): A QGIS vector layer.
-
parseQGISGeometry.
layerRemoveVirtualGeometryField
(vectorLayer)¶ Removes the virtual field called ‘Geometry’ from a vector layer if it exists.
- Args:
- vectorLayer (QgsVectorLayer): A QGIS vector layer.
-
parseQGISGeometry.
layer_review
(layer)¶ IN DEVELOPMENT - NOT CURRENTLY USED BY PLUGIN
Reviews any vector layer for the presence of Null or Empty geometries. Provides a summary of the vector geometry types that occur within a layer.
- Args:
- vectorLayer (QgsVectorLayer): A QGIS vector layer.
zipGeomAttribute module¶
Contains methods for zipping the minimum compiled source scripts needed for this plugin to function within QGIS. These methods do not do any of the compilation (e.g. update documentation, or, compile the QT Designer interface).
-
zipGeomAttribute.
installGeomAttributeFromZip
(pluginPath)¶ Unzips the zipped plugin folder. An automation used for testing.
- Args:
- pluginPath (str): The path of the plugin folder in the user’s installation of QGIS.
-
zipGeomAttribute.
zipGeomAttribute
()¶ Zips the minimum number of files needed for the plugin to be installed into QGIS