QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
Classes | Public Types | 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>

Public Types

enum  GeometryType {
  PointGeometry, LineGeometry, PolygonGeometry, UnknownGeometry,
  NullGeometry
}
 
enum  Type {
  Unknown = 0, Point = 1, LineString = 2, Polygon = 3,
  MultiPoint = 4, MultiLineString = 5, MultiPolygon = 6, GeometryCollection = 7,
  CircularString = 8, CompoundCurve = 9, CurvePolygon = 10, MultiCurve = 11,
  MultiSurface = 12, NoGeometry = 100, PointZ = 1001, LineStringZ = 1002,
  PolygonZ = 1003, MultiPointZ = 1004, MultiLineStringZ = 1005, MultiPolygonZ = 1006,
  GeometryCollectionZ = 1007, CircularStringZ = 1008, CompoundCurveZ = 1009, CurvePolygonZ = 1010,
  MultiCurveZ = 1011, MultiSurfaceZ = 1012, PointM = 2001, LineStringM = 2002,
  PolygonM = 2003, MultiPointM = 2004, MultiLineStringM = 2005, MultiPolygonM = 2006,
  GeometryCollectionM = 2007, CircularStringM = 2008, CompoundCurveM = 2009, CurvePolygonM = 2010,
  MultiCurveM = 2011, MultiSurfaceM = 2012, PointZM = 3001, LineStringZM = 3002,
  PolygonZM = 3003, MultiPointZM = 3004, MultiLineStringZM = 3005, MultiPolygonZM = 3006,
  GeometryCollectionZM = 3007, CircularStringZM = 3008, CompoundCurveZM = 3009, CurvePolygonZM = 3010,
  MultiCurveZM = 3011, MultiSurfaceZM = 3012, Point25D = 0x80000001, LineString25D,
  Polygon25D, MultiPoint25D, MultiLineString25D, MultiPolygon25D
}
 

Static Public Member Functions

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

Detailed Description

Handles storage of information regarding WKB types and their properties.

Note
Added in version 2.10

Definition at line 36 of file qgswkbtypes.h.

Member Enumeration Documentation

◆ GeometryType

Enumerator
PointGeometry 
LineGeometry 
PolygonGeometry 
UnknownGeometry 
NullGeometry 

Definition at line 100 of file qgswkbtypes.h.

◆ Type

Enumerator
Unknown 
Point 
LineString 
Polygon 
MultiPoint 
MultiLineString 
MultiPolygon 
GeometryCollection 
CircularString 
CompoundCurve 
CurvePolygon 
MultiCurve 
MultiSurface 
NoGeometry 
PointZ 
LineStringZ 
PolygonZ 
MultiPointZ 
MultiLineStringZ 
MultiPolygonZ 
GeometryCollectionZ 
CircularStringZ 
CompoundCurveZ 
CurvePolygonZ 
MultiCurveZ 
MultiSurfaceZ 
PointM 
LineStringM 
PolygonM 
MultiPointM 
MultiLineStringM 
MultiPolygonM 
GeometryCollectionM 
CircularStringM 
CompoundCurveM 
CurvePolygonM 
MultiCurveM 
MultiSurfaceM 
PointZM 
LineStringZM 
PolygonZM 
MultiPointZM 
MultiLineStringZM 
MultiPolygonZM 
GeometryCollectionZM 
CircularStringZM 
CompoundCurveZM 
CurvePolygonZM 
MultiCurveZM 
MultiSurfaceZM 
Point25D 
LineString25D 
Polygon25D 
MultiPoint25D 
MultiLineString25D 
MultiPolygon25D 

Definition at line 40 of file qgswkbtypes.h.

Member Function Documentation

◆ addM()

static Type QgsWKBTypes::addM ( Type  type)
inlinestatic

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

Parameters
typeoriginal type
Note
added in QGIS 2.12
See also
addZ()
dropM()
hasM()

Definition at line 781 of file qgswkbtypes.h.

◆ addZ()

static Type QgsWKBTypes::addZ ( Type  type)
inlinestatic

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

Parameters
typeoriginal type
Note
added in QGIS 2.12
See also
addM()
dropZ()
hasZ()

Definition at line 757 of file qgswkbtypes.h.

◆ coordDimensions()

static int QgsWKBTypes::coordDimensions ( Type  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.

Note
added in QGIS 2.14
See also
wkbDimensions()

Definition at line 573 of file qgswkbtypes.h.

◆ displayString()

QString QgsWKBTypes::displayString ( Type  type)
static

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

Definition at line 48 of file qgswkbtypes.cpp.

◆ dropM()

static Type QgsWKBTypes::dropM ( Type  type)
inlinestatic

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

Parameters
typeoriginal type
Note
added in QGIS 2.14
See also
dropZ()
addM()

Definition at line 828 of file qgswkbtypes.h.

◆ dropZ()

static Type QgsWKBTypes::dropZ ( Type  type)
inlinestatic

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

Parameters
typeoriginal type
Note
added in QGIS 2.14
See also
dropM()
addZ()

Definition at line 811 of file qgswkbtypes.h.

◆ flatType()

static Type QgsWKBTypes::flatType ( Type  type)
inlinestatic

Returns the flat type for a WKB type.

This is the WKB type minus any Z or M dimensions. Eg, for PolygonZM WKB types the single type would be Polygon.

See also
singleType()
multiType()

Definition at line 366 of file qgswkbtypes.h.

◆ geometryType()

static GeometryType QgsWKBTypes::geometryType ( Type  type)
inlinestatic

Returns the geometry type for a WKB type, eg both MultiPolygon and CurvePolygon would have a PolygonGeometry geometry type.

Definition at line 584 of file qgswkbtypes.h.

◆ hasM()

static bool QgsWKBTypes::hasM ( Type  type)
inlinestatic

Tests whether a WKB type contains m values.

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

Definition at line 714 of file qgswkbtypes.h.

◆ hasZ()

static bool QgsWKBTypes::hasZ ( Type  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 667 of file qgswkbtypes.h.

◆ isCurvedType()

static bool QgsWKBTypes::isCurvedType ( Type  type)
inlinestatic

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

Note
added in QGIS 2.14

Definition at line 531 of file qgswkbtypes.h.

◆ isMultiType()

static bool QgsWKBTypes::isMultiType ( Type  type)
inlinestatic

Returns true if the WKB type is a multi type.

See also
isSingleType()
multiType()

Definition at line 487 of file qgswkbtypes.h.

◆ isSingleType()

static bool QgsWKBTypes::isSingleType ( Type  type)
inlinestatic

Returns true if the WKB type is a single type.

See also
isMultiType()
singleType()

Definition at line 478 of file qgswkbtypes.h.

◆ multiType()

static Type QgsWKBTypes::multiType ( Type  type)
inlinestatic

Returns the multi type for a WKB type.

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

See also
isMultiType()
singleType()
flatType()

Definition at line 240 of file qgswkbtypes.h.

◆ parseType()

QgsWKBTypes::Type QgsWKBTypes::parseType ( const QString wktStr)
static

Attempts to extract the WKB type from a WKT string.

Parameters
wktStra valid WKT string

Definition at line 32 of file qgswkbtypes.cpp.

◆ singleType()

static Type QgsWKBTypes::singleType ( Type  type)
inlinestatic

Returns the single type for a WKB type.

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

See also
isSingleType()
multiType()
flatType()

Definition at line 114 of file qgswkbtypes.h.

◆ to25D()

static Type QgsWKBTypes::to25D ( Type  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 844 of file qgswkbtypes.h.

◆ wkbDimensions()

static int QgsWKBTypes::wkbDimensions ( Type  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 553 of file qgswkbtypes.h.

◆ zmType()

static Type QgsWKBTypes::zmType ( Type  type,
bool  hasZ,
bool  hasM 
)
inlinestatic

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

Definition at line 459 of file qgswkbtypes.h.


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