QGIS API Documentation  2.14.0-Essen
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...
 

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

Enumerator
PointGeometry 
LineGeometry 
PolygonGeometry 
UnknownGeometry 
NullGeometry 

Definition at line 100 of file qgswkbtypes.h.

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

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 770 of file qgswkbtypes.h.

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 746 of file qgswkbtypes.h.

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 562 of file qgswkbtypes.h.

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.

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 817 of file qgswkbtypes.h.

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 800 of file qgswkbtypes.h.

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.

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 573 of file qgswkbtypes.h.

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 703 of file qgswkbtypes.h.

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 656 of file qgswkbtypes.h.

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 520 of file qgswkbtypes.h.

static bool QgsWKBTypes::isMultiType ( Type  type)
inlinestatic

Returns true if the WKB type is a multi type.

See also
isSingleType()
multiType()

Definition at line 476 of file qgswkbtypes.h.

static bool QgsWKBTypes::isSingleType ( Type  type)
inlinestatic

Returns true if the WKB type is a single type.

See also
isMultiType()
singleType()

Definition at line 467 of file qgswkbtypes.h.

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.

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.

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.

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 833 of file qgswkbtypes.h.

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 542 of file qgswkbtypes.h.


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