QGIS API Documentation 3.34.0-Prizren (ffbdd678812)
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
QgsWkbTypes Class Reference

Handles storage of information regarding WKB types and their properties. More...

#include <qgswkbtypes.h>

Static Public Member Functions

static Qgis::WkbType addM (Qgis::WkbType type)
 Adds the m dimension to a WKB type and returns the new type.
 
static Qgis::WkbType addZ (Qgis::WkbType type)
 Adds the z dimension to a WKB type and returns the new type.
 
static int coordDimensions (Qgis::WkbType type)
 Returns the coordinate dimension of the geometry type as an integer.
 
static Qgis::WkbType curveType (Qgis::WkbType type)
 Returns the curve type for a WKB type.
 
static QString displayString (Qgis::WkbType type)
 Returns a non-translated display string type for a WKB type, e.g., the geometry name used in WKT geometry representations.
 
static Qgis::WkbType dropM (Qgis::WkbType type)
 Drops the m dimension (if present) for a WKB type and returns the new type.
 
static Qgis::WkbType dropZ (Qgis::WkbType type)
 Drops the z dimension (if present) for a WKB type and returns the new type.
 
static Qgis::WkbType flatType (Qgis::WkbType type)
 Returns the flat type for a WKB type.
 
static QString geometryDisplayString (Qgis::GeometryType type)
 Returns a display string for a geometry type.
 
static Qgis::GeometryType geometryType (Qgis::WkbType type)
 Returns the geometry type for a WKB type, e.g., both MultiPolygon and CurvePolygon would have a PolygonGeometry geometry type.
 
static bool hasM (Qgis::WkbType type)
 Tests whether a WKB type contains m values.
 
static bool hasZ (Qgis::WkbType type)
 Tests whether a WKB type contains the z-dimension.
 
static bool isCurvedType (Qgis::WkbType type)
 Returns true if the WKB type is a curved type or can contain curved geometries.
 
static bool isMultiType (Qgis::WkbType type)
 Returns true if the WKB type is a multi type.
 
static bool isSingleType (Qgis::WkbType type)
 Returns true if the WKB type is a single type.
 
static Qgis::WkbType linearType (Qgis::WkbType type)
 Returns the linear type for a WKB type.
 
static Qgis::WkbType multiType (Qgis::WkbType type)
 Returns the multi type for a WKB type.
 
static Qgis::WkbType parseType (const QString &wktStr)
 Attempts to extract the WKB type from a WKT string.
 
static Qgis::WkbType promoteNonPointTypesToMulti (Qgis::WkbType type)
 Promotes a WKB geometry type to its multi-type equivalent, with the exception of point geometry types.
 
static Qgis::WkbType singleType (Qgis::WkbType type)
 Returns the single type for a WKB type.
 
static Qgis::WkbType to25D (Qgis::WkbType type)
 Will convert the 25D version of the flat type if supported or Unknown if not supported.
 
static QString translatedDisplayString (Qgis::WkbType type)
 Returns a translated display string type for a WKB type, e.g., the geometry name used in WKT geometry representations.
 
static int wkbDimensions (Qgis::WkbType type)
 Returns the inherent dimension of the geometry type as an integer.
 
static Qgis::WkbType zmType (Qgis::WkbType type, bool hasZ, bool hasM)
 Returns the modified input geometry type according to hasZ / hasM.
 

Detailed Description

Handles storage of information regarding WKB types and their properties.

Since
QGIS 2.10

Definition at line 42 of file qgswkbtypes.h.

Member Function Documentation

◆ addM()

static Qgis::WkbType QgsWkbTypes::addM ( Qgis::WkbType  type)
inlinestatic

Adds the m dimension to a WKB type and returns the new type.

Parameters
typeoriginal type
See also
addZ()
dropM()
hasM()
Since
QGIS 2.12

Definition at line 1098 of file qgswkbtypes.h.

◆ addZ()

static Qgis::WkbType QgsWkbTypes::addZ ( Qgis::WkbType  type)
inlinestatic

Adds the z dimension to a WKB type and returns the new type.

Parameters
typeoriginal type
See also
addM()
dropZ()
hasZ()
Since
QGIS 2.12

Definition at line 1073 of file qgswkbtypes.h.

◆ coordDimensions()

static int QgsWkbTypes::coordDimensions ( Qgis::WkbType  type)
inlinestatic

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
wkbDimensions()
Since
QGIS 2.14

Definition at line 852 of file qgswkbtypes.h.

◆ curveType()

static Qgis::WkbType QgsWkbTypes::curveType ( Qgis::WkbType  type)
inlinestatic

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
linearType()
isMultiType()
isCurvedType()
singleType()
flatType()
multiType()
Since
QGIS 3.10

Definition at line 378 of file qgswkbtypes.h.

◆ displayString()

QString QgsWkbTypes::displayString ( Qgis::WkbType  type)
static

Returns a non-translated display string type for a WKB type, e.g., the geometry name used in WKT geometry representations.

Definition at line 145 of file qgswkbtypes.cpp.

◆ dropM()

static Qgis::WkbType QgsWkbTypes::dropM ( Qgis::WkbType  type)
inlinestatic

Drops the m dimension (if present) for a WKB type and returns the new type.

Parameters
typeoriginal type
See also
dropZ()
addM()
Since
QGIS 2.14

Definition at line 1152 of file qgswkbtypes.h.

◆ dropZ()

static Qgis::WkbType QgsWkbTypes::dropZ ( Qgis::WkbType  type)
inlinestatic

Drops the z dimension (if present) for a WKB type and returns the new type.

Parameters
typeoriginal type
See also
dropM()
addZ()
Since
QGIS 2.14

Definition at line 1134 of file qgswkbtypes.h.

◆ flatType()

static Qgis::WkbType QgsWkbTypes::flatType ( Qgis::WkbType  type)
inlinestatic

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
singleType()
multiType()
curveType()

Definition at line 629 of file qgswkbtypes.h.

◆ geometryDisplayString()

QString QgsWkbTypes::geometryDisplayString ( Qgis::GeometryType  type)
static

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
Since
QGIS 3.0

Definition at line 223 of file qgswkbtypes.cpp.

◆ geometryType()

static Qgis::GeometryType QgsWkbTypes::geometryType ( Qgis::WkbType  type)
inlinestatic

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.

Definition at line 865 of file qgswkbtypes.h.

◆ hasM()

static bool QgsWkbTypes::hasM ( Qgis::WkbType  type)
inlinestatic

Tests whether a WKB type contains m values.

Returns
true if type has m values
See also
addM()
hasZ()

Definition at line 1027 of file qgswkbtypes.h.

◆ hasZ()

static bool QgsWkbTypes::hasZ ( Qgis::WkbType  type)
inlinestatic

Tests whether a WKB type contains the z-dimension.

Returns
true if type has z values
See also
addZ()
hasM()

Definition at line 977 of file qgswkbtypes.h.

◆ isCurvedType()

static bool QgsWkbTypes::isCurvedType ( Qgis::WkbType  type)
inlinestatic

Returns true if the WKB type is a curved type or can contain curved geometries.

Since
QGIS 2.14

Definition at line 808 of file qgswkbtypes.h.

◆ isMultiType()

static bool QgsWkbTypes::isMultiType ( Qgis::WkbType  type)
inlinestatic

Returns true if the WKB type is a multi type.

See also
isSingleType()
multiType()

Definition at line 759 of file qgswkbtypes.h.

◆ isSingleType()

static bool QgsWkbTypes::isSingleType ( Qgis::WkbType  type)
inlinestatic

Returns true if the WKB type is a single type.

See also
isMultiType()
singleType()

Definition at line 749 of file qgswkbtypes.h.

◆ linearType()

static Qgis::WkbType QgsWkbTypes::linearType ( Qgis::WkbType  type)
inlinestatic

Returns the linear type for a WKB type.

For example, for a CompoundCurve, the linear type would be LineString.

See also
curveType()
isMultiType()
isCurvedType()
singleType()
flatType()
multiType()
Since
QGIS 3.14

Definition at line 519 of file qgswkbtypes.h.

◆ multiType()

static Qgis::WkbType QgsWkbTypes::multiType ( Qgis::WkbType  type)
inlinestatic

Returns the multi type for a WKB type.

For example, for Polygon WKB types the multi type would be MultiPolygon.

See also
promoteNonPointTypesToMulti()
isMultiType()
singleType()
curveType()
flatType()

Definition at line 201 of file qgswkbtypes.h.

◆ parseType()

static Qgis::WkbType QgsWkbTypes::parseType ( const QString &  wktStr)
static

Attempts to extract the WKB type from a WKT string.

Parameters
wktStra valid WKT string

◆ promoteNonPointTypesToMulti()

static Qgis::WkbType QgsWkbTypes::promoteNonPointTypesToMulti ( Qgis::WkbType  type)
inlinestatic

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
multiType()
singleType()
Since
QGIS 3.24

Definition at line 348 of file qgswkbtypes.h.

◆ singleType()

static Qgis::WkbType QgsWkbTypes::singleType ( Qgis::WkbType  type)
inlinestatic

Returns the single type for a WKB type.

For example, for MultiPolygon WKB types the single type would be Polygon.

See also
isSingleType()
multiType()
curveType()
flatType()

Definition at line 54 of file qgswkbtypes.h.

◆ to25D()

static Qgis::WkbType QgsWkbTypes::to25D ( Qgis::WkbType  type)
inlinestatic

Will convert the 25D version of the flat type if supported or Unknown if not supported.

Parameters
typeThe type to convert
Returns
the 25D version of the type or Unknown

Definition at line 1168 of file qgswkbtypes.h.

◆ translatedDisplayString()

QString QgsWkbTypes::translatedDisplayString ( Qgis::WkbType  type)
static

Returns a translated display string type for a WKB type, e.g., the geometry name used in WKT geometry representations.

Since
QGIS 3.18

Definition at line 155 of file qgswkbtypes.cpp.

◆ wkbDimensions()

static int QgsWkbTypes::wkbDimensions ( Qgis::WkbType  type)
inlinestatic

Returns the inherent dimension of the geometry type as an integer.

Returned value will always be less than or equal to the coordinate dimension.

Returns
0 for point geometries, 1 for line geometries, 2 for polygon geometries Invalid geometry types will return a dimension of 0.
See also
coordDimensions()

Definition at line 831 of file qgswkbtypes.h.

◆ zmType()

static Qgis::WkbType QgsWkbTypes::zmType ( Qgis::WkbType  type,
bool  hasZ,
bool  hasM 
)
inlinestatic

Returns the modified input geometry type according to hasZ / hasM.

Definition at line 728 of file qgswkbtypes.h.


The documentation for this class was generated from the following files: