/
qgswkbtypes.sip
198 lines (177 loc) · 5.26 KB
/
qgswkbtypes.sip
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
class QgsWKBTypes
{
%TypeHeaderCode
#include <qgswkbtypes.h>
%End
public:
enum Type
{
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
};
enum GeometryType
{
PointGeometry,
LineGeometry,
PolygonGeometry,
UnknownGeometry,
NullGeometry
};
/** Returns the single type for a WKB type. Eg, for MultiPolygon WKB types the single type would be Polygon.
* @see isSingleType()
* @see multiType()
* @see flatType()
*/
static Type singleType( Type type );
/** Returns the multi type for a WKB type. Eg, for Polygon WKB types the multi type would be MultiPolygon.
* @see isMultiType()
* @see singleType()
* @see flatType()
*/
static Type multiType( Type type );
/** 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 singleType()
* @see multiType()
*/
static Type flatType( Type type );
/** Attempts to extract the WKB type from a WKT string.
* @param wktStr a valid WKT string
*/
static Type parseType( const QString& wktStr );
/** Returns true if the WKB type is a single type.
* @see isMultiType()
* @see singleType()
*/
static bool isSingleType( Type type );
/** Returns true if the WKB type is a multi type.
* @see isSingleType()
* @see multiType()
*/
static bool isMultiType( Type type );
/** Returns true if the WKB type is a curved type or can contain curved geometries.
* @note added in QGIS 2.14
*/
static bool isCurvedType( Type type );
/** 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 coordDimensions()
*/
static int wkbDimensions( Type type );
/** 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 wkbDimensions()
*/
static int coordDimensions( Type type );
/** Returns the geometry type for a WKB type, eg both MultiPolygon and CurvePolygon would have a
* PolygonGeometry geometry type.
*/
static GeometryType geometryType( Type type );
/** Returns a display string type for a WKB type, eg the geometry name used in WKT geometry representations.
*/
static QString displayString( Type type );
/** Tests whether a WKB type contains the z-dimension.
* @returns true if type has z values
* @see addZ()
* @see hasM()
*/
static bool hasZ( Type type );
/** Tests whether a WKB type contains m values.
* @returns true if type has m values
* @see addM()
* @see hasZ()
*/
static bool hasM( Type type );
/** Adds the z dimension to a WKB type and returns the new type
* @param type original type
* @note added in QGIS 2.12
* @see addM()
* @see hasZ()
*/
static Type addZ( Type type );
/** Adds the m dimension to a WKB type and returns the new type
* @param type original type
* @note added in QGIS 2.12
* @see addZ()
* @see hasM()
*/
static Type addM( Type type );
/** Drops the z dimension (if present) for a WKB type and returns the new type.
* @param type original type
* @note added in QGIS 2.14
* @see dropM()
* @see addZ()
*/
static Type dropZ( Type type );
/** Drops the m dimension (if present) for a WKB type and returns the new type.
* @param type original type
* @note added in QGIS 2.14
* @see dropZ()
* @see addM()
*/
static Type dropM( Type type );
/**
* Will convert the 25D version of the flat type if supported or Unknown if not supported.
* @param type The type to convert
* @return the 25D version of the type or Unknown
*/
static Type to25D( Type type );
};