49 GeometryCollection = 7,
60 MultiLineStringZ = 1005,
62 GeometryCollectionZ = 1007,
63 CircularStringZ = 1008,
64 CompoundCurveZ = 1009,
72 MultiLineStringM = 2005,
74 GeometryCollectionM = 2007,
75 CircularStringM = 2008,
76 CompoundCurveM = 2009,
84 MultiLineStringZM = 3005,
85 MultiPolygonZM = 3006,
86 GeometryCollectionZM = 3007,
87 CircularStringZM = 3008,
88 CompoundCurveZM = 3009,
89 CurvePolygonZM = 3010,
91 MultiSurfaceZM = 3012,
92 Point25D = 0x80000001,
119 case GeometryCollection:
120 case GeometryCollectionZ:
121 case GeometryCollectionM:
122 case GeometryCollectionZM:
142 case MultiLineString:
146 case MultiLineStringZ:
150 case MultiLineStringM:
154 case MultiLineStringZM:
174 return CircularString;
176 case CircularStringZ:
177 return CircularStringZ;
179 case CircularStringM:
180 return CircularStringM;
182 case CircularStringZM:
183 return CircularStringZM;
187 return CompoundCurve;
191 return CompoundCurveZ;
195 return CompoundCurveM;
197 case CompoundCurveZM:
199 return CompoundCurveZM;
207 return CurvePolygonZ;
211 return CurvePolygonM;
215 return CurvePolygonZM;
225 case MultiLineString25D:
226 return LineString25D;
229 case MultiPolygon25D:
247 case GeometryCollection:
248 return GeometryCollection;
250 case GeometryCollectionZ:
251 return GeometryCollectionZ;
253 case GeometryCollectionM:
254 return GeometryCollectionM;
256 case GeometryCollectionZM:
257 return GeometryCollectionZM;
276 case MultiLineString:
277 return MultiLineString;
280 case MultiLineStringZ:
281 return MultiLineStringZ;
284 case MultiLineStringM:
285 return MultiLineStringM;
288 case MultiLineStringZM:
289 return MultiLineStringZM;
297 return MultiPolygonZ;
301 return MultiPolygonM;
305 return MultiPolygonZM;
313 case CircularStringZ:
318 case CircularStringM:
322 case CompoundCurveZM:
323 case CircularStringZM:
333 return MultiSurfaceZ;
337 return MultiSurfaceM;
341 return MultiSurfaceZM;
348 return MultiPoint25D;
351 case MultiLineString25D:
352 return MultiLineString25D;
355 case MultiPolygon25D:
356 return MultiPolygon25D;
401 case MultiLineString:
402 case MultiLineStringZ:
403 case MultiLineStringM:
404 case MultiLineStringZM:
405 case MultiLineString25D:
406 return MultiLineString;
412 case MultiPolygon25D:
415 case GeometryCollection:
416 case GeometryCollectionZ:
417 case GeometryCollectionM:
418 case GeometryCollectionZM:
419 return GeometryCollection;
422 case CircularStringZ:
423 case CircularStringM:
424 case CircularStringZM:
425 return CircularString;
430 case CompoundCurveZM:
431 return CompoundCurve;
461 type = flatType( type );
480 return ( type !=
Unknown && !isMultiType( type ) );
502 case CircularStringZ:
508 case CircularStringM:
514 case CircularStringZM:
515 case CompoundCurveZM:
533 switch ( flatType( type ) )
560 case PolygonGeometry:
575 if ( type ==
Unknown || type == NoGeometry )
578 return 2 + hasZ( type ) + hasM( type );
589 case GeometryCollection:
590 case GeometryCollectionZ:
591 case GeometryCollectionM:
592 case GeometryCollectionZM:
593 return UnknownGeometry;
605 return PointGeometry;
608 case MultiLineString:
610 case MultiLineStringZ:
612 case MultiLineStringM:
614 case MultiLineStringZM:
616 case MultiLineString25D:
620 case CircularStringZ:
623 case CircularStringM:
626 case CircularStringZM:
627 case CompoundCurveZM:
640 case MultiPolygon25D:
649 return PolygonGeometry;
655 return UnknownGeometry;
675 case MultiLineStringZ:
677 case GeometryCollectionZ:
678 case CircularStringZ:
687 case MultiLineStringZM:
689 case GeometryCollectionZM:
690 case CircularStringZM:
691 case CompoundCurveZM:
699 case MultiLineString25D:
700 case MultiPolygon25D:
722 case MultiLineStringM:
724 case GeometryCollectionM:
725 case CircularStringM:
734 case MultiLineStringZM:
736 case GeometryCollectionZM:
737 case CircularStringZM:
738 case CompoundCurveZM:
763 else if ( type == NoGeometry )
767 Type flat = flatType( type );
787 else if ( type == NoGeometry )
789 else if ( type == Point25D ||
790 type == LineString25D ||
791 type == Polygon25D ||
792 type == MultiPoint25D ||
793 type == MultiLineString25D ||
794 type == MultiPolygon25D )
798 Type flat = flatType( type );
818 returnType = addM( returnType );
835 returnType = addZ( returnType );
848 if ( flat >= Point && flat <= MultiPolygon )
861 bool hasZ,
bool hasM )
863 , mIsMultiType( isMultiType )
864 , mMultiType( multiType )
865 , mSingleType( singleType )
866 , mFlatType( flatType )
867 , mGeometryType( geometryType )
885 #endif // QGSWKBTYPES_H static int coordDimensions(Type type)
Returns the coordinate dimension of the geometry type as an integer.
static bool isSingleType(Type type)
Returns true if the WKB type is a single type.
static Type addZ(Type type)
Adds the z dimension to a WKB type and returns the new type.
static bool hasM(Type type)
Tests whether a WKB type contains m values.
static Type multiType(Type type)
Returns the multi type for a WKB type.
static bool isMultiType(Type type)
Returns true if the WKB type is a multi type.
static bool hasZ(Type type)
Tests whether a WKB type contains the z-dimension.
static Type dropZ(Type type)
Drops the z dimension (if present) for a WKB type and returns the new type.
static Type addM(Type type)
Adds the m dimension to a WKB type and returns the new type.
static bool isCurvedType(Type type)
Returns true if the WKB type is a curved type or can contain curved geometries.
static Type zmType(Type type, bool hasZ, bool hasM)
Returns the modified input geometry type according to hasZ / hasM.
static GeometryType geometryType(Type type)
Returns the geometry type for a WKB type, eg both MultiPolygon and CurvePolygon would have a PolygonG...
static Type dropM(Type type)
Drops the m dimension (if present) for a WKB type and returns the new type.
Handles storage of information regarding WKB types and their properties.
static Type flatType(Type type)
Returns the flat type for a WKB type.
static Type to25D(Type type)
Will convert the 25D version of the flat type if supported or Unknown if not supported.
static int wkbDimensions(Type type)
Returns the inherent dimension of the geometry type as an integer.
static Type singleType(Type type)
Returns the single type for a WKB type.