Class: QgsWkbTypes¶
- class qgis.core.QgsWkbTypes¶
Bases:
sip.wrapper
Handles storage of information regarding WKB types and their properties.
Enums
Bases:
enum.IntEnum
alias of
WkbType
Methods
Adds the m dimension to a WKB type and returns the new type
Adds the z dimension to a WKB type and returns the new type
Returns the coordinate dimension of the geometry type as an integer.
Returns the curve type for a WKB type.
Returns a non-translated display string type for a WKB type, e.g., the geometry name used in WKT geometry representations.
Drops the m dimension (if present) for a WKB type and returns the new type.
Drops the z dimension (if present) for a WKB type and returns the new type.
Returns the flat type for a WKB type.
Returns a display string for a geometry type.
Returns the geometry type for a WKB type, e.g., both MultiPolygon and CurvePolygon would have a PolygonGeometry geometry type.
Tests whether a WKB type contains m values.
Tests whether a WKB type contains the z-dimension.
Returns
True
if the WKB type is a curved type or can contain curved geometries.Returns
True
if the WKB type is a multi type.Returns
True
if the WKB type is a single type.Returns the linear type for a WKB type.
Returns the multi type for a WKB type.
Attempts to extract the WKB type from a WKT string.
Promotes a WKB geometry type to its multi-type equivalent, with the exception of point geometry types.
Returns the single type for a WKB type.
Will convert the 25D version of the flat type if supported or Unknown if not supported.
Returns a translated display string type for a WKB type, e.g., the geometry name used in WKT geometry representations.
Returns the inherent dimension of the geometry type as an integer.
Returns the modified input geometry type according to hasZ / hasM
Attributes
- class GeometryType(value)¶
Bases:
enum.IntEnum
The geometry types are used to group Qgis.WkbType in a coarse way.
Note
Prior to 3.30 this was available as
QgsWkbTypes
.GeometryType.New in version 3.30.
PointGeometry
: PointsLineGeometry
: LinesPolygonGeometry
: PolygonsUnknownGeometry
: Unknown typesNullGeometry
: No geometry
- addM(type: Qgis.WkbType) Qgis.WkbType ¶
Adds the m dimension to a WKB type and returns the new type
- Parameters:
type (Qgis.WkbType) – original type
See also
See also
See also
- Return type:
- addZ(type: Qgis.WkbType) Qgis.WkbType ¶
Adds the z dimension to a WKB type and returns the new type
- Parameters:
type (Qgis.WkbType) – original type
See also
See also
See also
- Return type:
- coordDimensions(type: Qgis.WkbType) int ¶
Returns the coordinate dimension of the geometry type as an integer. Returned value will be between 2-4, depending on whether the geometry type contains the Z or M dimensions. Invalid geometry types will return a dimension of 0.
See also
- Parameters:
type (Qgis.WkbType) –
- Return type:
int
- curveType(type: Qgis.WkbType) Qgis.WkbType ¶
Returns the curve type for a WKB type. For example, for Polygon WKB types the curve type would be CurvePolygon.
Note
Returns CompoundCurve for CircularString (and its Z/M variants)
See also
See also
See also
See also
See also
See also
New in version 3.10.
- Parameters:
type (Qgis.WkbType) –
- Return type:
- displayString(type: Qgis.WkbType) str ¶
Returns a non-translated display string type for a WKB type, e.g., the geometry name used in WKT geometry representations.
- Parameters:
type (Qgis.WkbType) –
- Return type:
str
- dropM(type: Qgis.WkbType) Qgis.WkbType ¶
Drops the m dimension (if present) for a WKB type and returns the new type.
- Parameters:
type (Qgis.WkbType) – original type
See also
See also
- Return type:
- dropZ(type: Qgis.WkbType) Qgis.WkbType ¶
Drops the z dimension (if present) for a WKB type and returns the new type.
- Parameters:
type (Qgis.WkbType) – original type
See also
See also
- Return type:
- flatType(type: Qgis.WkbType) Qgis.WkbType ¶
Returns the flat type for a WKB type. This is the WKB type minus any Z or M dimensions. For example, for PolygonZM WKB types the single type would be Polygon.
See also
See also
See also
- Parameters:
type (Qgis.WkbType) –
- Return type:
- geometryDisplayString(type: Qgis.GeometryType) str ¶
Returns a display string for a geometry type.
This will return one of the following strings:
Point
Line
Polygon
Unknown Geometry
No Geometry
Invalid Geometry
- Parameters:
type (Qgis.GeometryType) –
- Return type:
str
- geometryType(type: Qgis.WkbType) Qgis.GeometryType ¶
Returns the geometry type for a WKB type, e.g., both MultiPolygon and CurvePolygon would have a PolygonGeometry geometry type. GeometryCollections are reported as
Qgis
.GeometryType.Unknown.- Parameters:
type (Qgis.WkbType) –
- Return type:
- hasM(type: Qgis.WkbType) bool ¶
Tests whether a WKB type contains m values.
- Return type:
bool
- Returns:
True
if type has m values
See also
See also
- Parameters:
type (Qgis.WkbType) –
- hasZ(type: Qgis.WkbType) bool ¶
Tests whether a WKB type contains the z-dimension.
- Return type:
bool
- Returns:
True
if type has z values
See also
See also
- Parameters:
type (Qgis.WkbType) –
- isCurvedType(type: Qgis.WkbType) bool ¶
Returns
True
if the WKB type is a curved type or can contain curved geometries.- Parameters:
type (Qgis.WkbType) –
- Return type:
bool
- isMultiType(type: Qgis.WkbType) bool ¶
Returns
True
if the WKB type is a multi type.See also
See also
- Parameters:
type (Qgis.WkbType) –
- Return type:
bool
- isSingleType(type: Qgis.WkbType) bool ¶
Returns
True
if the WKB type is a single type.See also
See also
- Parameters:
type (Qgis.WkbType) –
- Return type:
bool
- linearType(type: Qgis.WkbType) Qgis.WkbType ¶
Returns the linear type for a WKB type. For example, for a CompoundCurve, the linear type would be LineString.
See also
See also
See also
See also
See also
See also
New in version 3.14.
- Parameters:
type (Qgis.WkbType) –
- Return type:
- multiType(type: Qgis.WkbType) Qgis.WkbType ¶
Returns the multi type for a WKB type. For example, for Polygon WKB types the multi type would be MultiPolygon.
See also
See also
See also
See also
See also
- Parameters:
type (Qgis.WkbType) –
- Return type:
- parseType(wktStr: str) Qgis.WkbType ¶
Attempts to extract the WKB type from a WKT string.
- Parameters:
wktStr (str) – a valid WKT string
- Return type:
- promoteNonPointTypesToMulti(type: Qgis.WkbType) Qgis.WkbType ¶
Promotes a WKB geometry type to its multi-type equivalent, with the exception of point geometry types.
Specifically, this method should be used to determine the most-permissive possible resultant WKB type which can result from subtracting parts of a geometry. A single-point geometry type can never become a multi-point geometry type as a result of a subtraction, but a single-line or single-polygon geometry CAN become a multipart geometry as a result of subtracting portions of the geometry.
See also
See also
New in version 3.24.
- Parameters:
type (Qgis.WkbType) –
- Return type:
- singleType(type: Qgis.WkbType) Qgis.WkbType ¶
Returns the single type for a WKB type. For example, for MultiPolygon WKB types the single type would be Polygon.
See also
See also
See also
See also
- Parameters:
type (Qgis.WkbType) –
- Return type:
- staticMetaObject = <PyQt5.QtCore.QMetaObject object>¶
- to25D(type: Qgis.WkbType) Qgis.WkbType ¶
Will convert the 25D version of the flat type if supported or Unknown if not supported.
- Parameters:
type (Qgis.WkbType) – The type to convert
- Return type:
- Returns:
the 25D version of the type or Unknown
- translatedDisplayString(type: Qgis.WkbType) str ¶
Returns a translated display string type for a WKB type, e.g., the geometry name used in WKT geometry representations.
New in version 3.18.
- Parameters:
type (Qgis.WkbType) –
- Return type:
str
- wkbDimensions(type: Qgis.WkbType) int ¶
Returns the inherent dimension of the geometry type as an integer. Returned value will always be less than or equal to the coordinate dimension.
- Return type:
int
- Returns:
0 for point geometries, 1 for line geometries, 2 for polygon geometries Invalid geometry types will return a dimension of 0.
See also
- Parameters:
type (Qgis.WkbType) –
- zmType(type: Qgis.WkbType, hasZ: bool, hasM: bool) Qgis.WkbType ¶
Returns the modified input geometry type according to hasZ / hasM
- Parameters:
type (Qgis.WkbType) –
hasZ (bool) –
hasM (bool) –
- Return type: