QGIS API Documentation
3.14.0-Pi (9f7028fd23)
|
Go to the documentation of this file.
25 #include "qgis_core.h"
78 GeometryCollection = 7,
90 MultiLineStringZ = 1005,
92 GeometryCollectionZ = 1007,
93 CircularStringZ = 1008,
94 CompoundCurveZ = 1009,
103 MultiLineStringM = 2005,
104 MultiPolygonM = 2006,
105 GeometryCollectionM = 2007,
106 CircularStringM = 2008,
107 CompoundCurveM = 2009,
108 CurvePolygonM = 2010,
110 MultiSurfaceM = 2012,
115 MultiLineStringZM = 3005,
116 MultiPolygonZM = 3006,
117 GeometryCollectionZM = 3007,
118 CircularStringZM = 3008,
119 CompoundCurveZM = 3009,
120 CurvePolygonZM = 3010,
122 MultiSurfaceZM = 3012,
124 Point25D = 0x80000001,
147 Q_ENUM( GeometryType )
161 case GeometryCollection:
162 case GeometryCollectionZ:
163 case GeometryCollectionM:
164 case GeometryCollectionZM:
184 case MultiLineString:
188 case MultiLineStringZ:
192 case MultiLineStringM:
196 case MultiLineStringZM:
232 return CircularString;
234 case CircularStringZ:
235 return CircularStringZ;
237 case CircularStringM:
238 return CircularStringM;
240 case CircularStringZM:
241 return CircularStringZM;
245 return CompoundCurve;
249 return CompoundCurveZ;
253 return CompoundCurveM;
255 case CompoundCurveZM:
257 return CompoundCurveZM;
265 return CurvePolygonZ;
269 return CurvePolygonM;
273 return CurvePolygonZM;
283 case MultiLineString25D:
284 return LineString25D;
287 case MultiPolygon25D:
313 return MultiPolygonZ;
316 return MultiPolygonM;
319 return MultiPolygonZM;
321 case GeometryCollection:
322 return GeometryCollection;
324 case GeometryCollectionZ:
325 return GeometryCollectionZ;
327 case GeometryCollectionM:
328 return GeometryCollectionM;
330 case GeometryCollectionZM:
331 return GeometryCollectionZM;
350 case MultiLineString:
351 return MultiLineString;
354 case MultiLineStringZ:
355 return MultiLineStringZ;
358 case MultiLineStringM:
359 return MultiLineStringM;
362 case MultiLineStringZM:
363 return MultiLineStringZM;
371 return MultiPolygonZ;
375 return MultiPolygonM;
379 return MultiPolygonZM;
387 case CircularStringZ:
392 case CircularStringM:
396 case CompoundCurveZM:
397 case CircularStringZM:
407 return MultiSurfaceZ;
411 return MultiSurfaceM;
415 return MultiSurfaceZM;
422 return MultiPoint25D;
425 case MultiLineString25D:
426 return MultiLineString25D;
429 case MultiPolygon25D:
430 return MultiPolygon25D;
461 case GeometryCollection:
462 return GeometryCollection;
464 case GeometryCollectionZ:
465 return GeometryCollectionZ;
467 case GeometryCollectionM:
468 return GeometryCollectionM;
470 case GeometryCollectionZM:
471 return GeometryCollectionZM;
500 return CompoundCurve;
502 case MultiLineString:
508 case CircularStringZ:
510 return CompoundCurveZ;
512 case MultiLineStringZ:
514 case MultiLineString25D:
519 case CircularStringM:
520 return CompoundCurveM;
522 case MultiLineStringM:
527 case CompoundCurveZM:
528 case CircularStringZM:
529 return CompoundCurveZM;
531 case MultiLineStringZM:
546 return CurvePolygonZ;
550 case MultiPolygon25D:
551 return MultiSurfaceZ;
555 return CurvePolygonM;
559 return MultiSurfaceM;
563 return CurvePolygonZM;
567 return MultiSurfaceZM;
574 return MultiPoint25D;
600 case CircularStringM:
604 case CircularStringZ:
608 case CircularStringZM:
609 case CompoundCurveZM:
613 return MultiLineString;
616 return MultiLineStringM;
619 return MultiLineStringZ;
622 return MultiLineStringZM;
640 return MultiPolygonM;
643 return MultiPolygonZ;
646 return MultiPolygonZM;
648 case GeometryCollection:
649 case GeometryCollectionM:
650 case GeometryCollectionZ:
651 case GeometryCollectionZM:
657 case MultiLineString:
658 case MultiLineString25D:
659 case MultiLineStringM:
660 case MultiLineStringZ:
661 case MultiLineStringZM:
668 case MultiPolygon25D:
742 case MultiLineString:
743 case MultiLineStringZ:
744 case MultiLineStringM:
745 case MultiLineStringZM:
746 case MultiLineString25D:
747 return MultiLineString;
753 case MultiPolygon25D:
756 case GeometryCollection:
757 case GeometryCollectionZ:
758 case GeometryCollectionM:
759 case GeometryCollectionZM:
760 return GeometryCollection;
763 case CircularStringZ:
764 case CircularStringM:
765 case CircularStringZM:
766 return CircularString;
771 case CompoundCurveZM:
772 return CompoundCurve;
802 type = flatType( type );
814 static Type parseType(
const QString &wktStr );
823 return ( type != Unknown && !isMultiType( type ) );
848 case CircularStringZ:
855 case CircularStringM:
862 case CircularStringZM:
863 case CompoundCurveZM:
882 switch ( flatType( type ) )
910 case PolygonGeometry:
926 if ( type == Unknown || type == NoGeometry )
929 return 2 + hasZ( type ) + hasM( type );
942 case GeometryCollection:
943 case GeometryCollectionZ:
944 case GeometryCollectionM:
945 case GeometryCollectionZM:
946 return UnknownGeometry;
958 return PointGeometry;
961 case MultiLineString:
963 case MultiLineStringZ:
965 case MultiLineStringM:
967 case MultiLineStringZM:
969 case MultiLineString25D:
973 case CircularStringZ:
976 case CircularStringM:
979 case CircularStringZM:
980 case CompoundCurveZM:
997 case MultiPolygon25D:
1004 case CurvePolygonZM:
1005 case MultiSurfaceZM:
1006 return PolygonGeometry;
1009 return NullGeometry;
1012 return UnknownGeometry;
1018 static QString displayString( Type type );
1034 static QString geometryDisplayString( GeometryType type );
1051 case MultiLineStringZ:
1053 case GeometryCollectionZ:
1054 case CircularStringZ:
1055 case CompoundCurveZ:
1064 case MultiLineStringZM:
1065 case MultiPolygonZM:
1066 case GeometryCollectionZM:
1067 case CircularStringZM:
1068 case CompoundCurveZM:
1069 case CurvePolygonZM:
1071 case MultiSurfaceZM:
1076 case MultiLineString25D:
1077 case MultiPolygon25D:
1101 case MultiLineStringM:
1103 case GeometryCollectionM:
1104 case CircularStringM:
1105 case CompoundCurveM:
1114 case MultiLineStringZM:
1115 case MultiPolygonZM:
1116 case GeometryCollectionZM:
1117 case CircularStringZM:
1118 case CompoundCurveZM:
1119 case CurvePolygonZM:
1121 case MultiSurfaceZM:
1142 else if ( type == Unknown )
1144 else if ( type == NoGeometry )
1148 Type flat = flatType( type );
1167 else if ( type == Unknown )
1169 else if ( type == NoGeometry )
1171 else if ( type == Point25D ||
1172 type == LineString25D ||
1173 type == Polygon25D ||
1174 type == MultiPoint25D ||
1175 type == MultiLineString25D ||
1176 type == MultiPolygon25D )
1180 Type flat = flatType( type );
1196 if ( !hasZ( type ) )
1201 returnType = addM( returnType );
1214 if ( !hasM( type ) )
1219 returnType = addZ( returnType );
1232 if ( flat >= Point && flat <= MultiPolygon )
1233 return static_cast< QgsWkbTypes::Type >(
static_cast<unsigned>( flat ) + 0x80000000U );
1242 #endif // QGSWKBTYPES_H
static Type multiType(Type type)
Returns the multi type for a WKB type.
static Type linearType(Type type)
Returns the linear type for a WKB type.
static int coordDimensions(Type type)
Returns the coordinate dimension of the geometry type as an integer.
static bool isMultiType(Type type)
Returns true if the WKB type is a multi type.
static Type to25D(Type type)
Will convert the 25D version of the flat type if supported or Unknown if not supported.
Type
The WKB type describes the number of dimensions a geometry has.
static bool hasZ(Type type)
Tests whether a WKB type contains the z-dimension.
static int wkbDimensions(Type type)
Returns the inherent dimension of the geometry type as an integer.
static Type dropM(Type type)
Drops the m 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 GeometryType geometryType(Type type)
Returns the geometry type for a WKB type, e.g., both MultiPolygon and CurvePolygon would have a Polyg...
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 Type zmType(Type type, bool hasZ, bool hasM)
Returns the modified input geometry type according to hasZ / hasM.
static bool hasM(Type type)
Tests whether a WKB type contains m values.
GeometryType
The geometry types are used to group QgsWkbTypes::Type in a coarse way.
static Type curveType(Type type)
Returns the curve type for a WKB type.
static bool isCurvedType(Type type)
Returns true if the WKB type is a curved type or can contain curved geometries.
Handles storage of information regarding WKB types and their properties.
static Type dropZ(Type type)
Drops the z dimension (if present) for a WKB type and returns the new type.
static Type flatType(Type type)
Returns the flat type for a WKB type.