QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
25 #include "qgis_core.h"
79 GeometryCollection = 7,
91 MultiLineStringZ = 1005,
93 GeometryCollectionZ = 1007,
94 CircularStringZ = 1008,
95 CompoundCurveZ = 1009,
104 MultiLineStringM = 2005,
105 MultiPolygonM = 2006,
106 GeometryCollectionM = 2007,
107 CircularStringM = 2008,
108 CompoundCurveM = 2009,
109 CurvePolygonM = 2010,
111 MultiSurfaceM = 2012,
116 MultiLineStringZM = 3005,
117 MultiPolygonZM = 3006,
118 GeometryCollectionZM = 3007,
119 CircularStringZM = 3008,
120 CompoundCurveZM = 3009,
121 CurvePolygonZM = 3010,
123 MultiSurfaceZM = 3012,
125 Point25D = 0x80000001,
148 Q_ENUM( GeometryType )
162 case GeometryCollection:
163 case GeometryCollectionZ:
164 case GeometryCollectionM:
165 case GeometryCollectionZM:
185 case MultiLineString:
189 case MultiLineStringZ:
193 case MultiLineStringM:
197 case MultiLineStringZM:
233 return CircularString;
235 case CircularStringZ:
236 return CircularStringZ;
238 case CircularStringM:
239 return CircularStringM;
241 case CircularStringZM:
242 return CircularStringZM;
246 return CompoundCurve;
250 return CompoundCurveZ;
254 return CompoundCurveM;
256 case CompoundCurveZM:
258 return CompoundCurveZM;
266 return CurvePolygonZ;
270 return CurvePolygonM;
274 return CurvePolygonZM;
284 case MultiLineString25D:
285 return LineString25D;
288 case MultiPolygon25D:
314 return MultiPolygonZ;
317 return MultiPolygonM;
320 return MultiPolygonZM;
322 case GeometryCollection:
323 return GeometryCollection;
325 case GeometryCollectionZ:
326 return GeometryCollectionZ;
328 case GeometryCollectionM:
329 return GeometryCollectionM;
331 case GeometryCollectionZM:
332 return GeometryCollectionZM;
351 case MultiLineString:
352 return MultiLineString;
355 case MultiLineStringZ:
356 return MultiLineStringZ;
359 case MultiLineStringM:
360 return MultiLineStringM;
363 case MultiLineStringZM:
364 return MultiLineStringZM;
372 return MultiPolygonZ;
376 return MultiPolygonM;
380 return MultiPolygonZM;
388 case CircularStringZ:
393 case CircularStringM:
397 case CompoundCurveZM:
398 case CircularStringZM:
408 return MultiSurfaceZ;
412 return MultiSurfaceM;
416 return MultiSurfaceZM;
423 return MultiPoint25D;
426 case MultiLineString25D:
427 return MultiLineString25D;
430 case MultiPolygon25D:
431 return MultiPolygon25D;
462 case GeometryCollection:
463 return GeometryCollection;
465 case GeometryCollectionZ:
466 return GeometryCollectionZ;
468 case GeometryCollectionM:
469 return GeometryCollectionM;
471 case GeometryCollectionZM:
472 return GeometryCollectionZM;
501 return CompoundCurve;
503 case MultiLineString:
509 case CircularStringZ:
511 return CompoundCurveZ;
513 case MultiLineStringZ:
515 case MultiLineString25D:
520 case CircularStringM:
521 return CompoundCurveM;
523 case MultiLineStringM:
528 case CompoundCurveZM:
529 case CircularStringZM:
530 return CompoundCurveZM;
532 case MultiLineStringZM:
547 return CurvePolygonZ;
551 case MultiPolygon25D:
552 return MultiSurfaceZ;
556 return CurvePolygonM;
560 return MultiSurfaceM;
564 return CurvePolygonZM;
568 return MultiSurfaceZM;
575 return MultiPoint25D;
601 case CircularStringM:
605 case CircularStringZ:
609 case CircularStringZM:
610 case CompoundCurveZM:
614 return MultiLineString;
617 return MultiLineStringM;
620 return MultiLineStringZ;
623 return MultiLineStringZM;
641 return MultiPolygonM;
644 return MultiPolygonZ;
647 return MultiPolygonZM;
649 case GeometryCollection:
650 case GeometryCollectionM:
651 case GeometryCollectionZ:
652 case GeometryCollectionZM:
658 case MultiLineString:
659 case MultiLineString25D:
660 case MultiLineStringM:
661 case MultiLineStringZ:
662 case MultiLineStringZM:
669 case MultiPolygon25D:
743 case MultiLineString:
744 case MultiLineStringZ:
745 case MultiLineStringM:
746 case MultiLineStringZM:
747 case MultiLineString25D:
748 return MultiLineString;
754 case MultiPolygon25D:
757 case GeometryCollection:
758 case GeometryCollectionZ:
759 case GeometryCollectionM:
760 case GeometryCollectionZM:
761 return GeometryCollection;
764 case CircularStringZ:
765 case CircularStringM:
766 case CircularStringZM:
767 return CircularString;
772 case CompoundCurveZM:
773 return CompoundCurve;
803 type = flatType( type );
824 return ( type != Unknown && !isMultiType( type ) );
849 case CircularStringZ:
856 case CircularStringM:
863 case CircularStringZM:
864 case CompoundCurveZM:
883 switch ( flatType( type ) )
911 case PolygonGeometry:
927 if ( type == Unknown || type == NoGeometry )
930 return 2 + hasZ( type ) + hasM( type );
943 case GeometryCollection:
944 case GeometryCollectionZ:
945 case GeometryCollectionM:
946 case GeometryCollectionZM:
947 return UnknownGeometry;
959 return PointGeometry;
962 case MultiLineString:
964 case MultiLineStringZ:
966 case MultiLineStringM:
968 case MultiLineStringZM:
970 case MultiLineString25D:
974 case CircularStringZ:
977 case CircularStringM:
980 case CircularStringZM:
981 case CompoundCurveZM:
998 case MultiPolygon25D:
1005 case CurvePolygonZM:
1006 case MultiSurfaceZM:
1007 return PolygonGeometry;
1010 return NullGeometry;
1013 return UnknownGeometry;
1019 static QString displayString( Type type )
SIP_HOLDGIL;
1035 static QString geometryDisplayString( GeometryType type )
SIP_HOLDGIL;
1052 case MultiLineStringZ:
1054 case GeometryCollectionZ:
1055 case CircularStringZ:
1056 case CompoundCurveZ:
1065 case MultiLineStringZM:
1066 case MultiPolygonZM:
1067 case GeometryCollectionZM:
1068 case CircularStringZM:
1069 case CompoundCurveZM:
1070 case CurvePolygonZM:
1072 case MultiSurfaceZM:
1077 case MultiLineString25D:
1078 case MultiPolygon25D:
1102 case MultiLineStringM:
1104 case GeometryCollectionM:
1105 case CircularStringM:
1106 case CompoundCurveM:
1115 case MultiLineStringZM:
1116 case MultiPolygonZM:
1117 case GeometryCollectionZM:
1118 case CircularStringZM:
1119 case CompoundCurveZM:
1120 case CurvePolygonZM:
1122 case MultiSurfaceZM:
1143 else if ( type == Unknown )
1145 else if ( type == NoGeometry )
1149 Type flat = flatType( type );
1168 else if ( type == Unknown )
1170 else if ( type == NoGeometry )
1172 else if ( type == Point25D ||
1173 type == LineString25D ||
1174 type == Polygon25D ||
1175 type == MultiPoint25D ||
1176 type == MultiLineString25D ||
1177 type == MultiPolygon25D )
1181 Type flat = flatType( type );
1197 if ( !hasZ( type ) )
1202 returnType = addM( returnType );
1215 if ( !hasM( type ) )
1220 returnType = addZ( returnType );
1233 if ( flat >= Point && flat <= MultiPolygon )
1234 return static_cast< QgsWkbTypes::Type >(
static_cast<unsigned>( flat ) + 0x80000000U );
1243 #endif // QGSWKBTYPES_H
static bool isSingleType(Type type) SIP_HOLDGIL
Returns true if the WKB type is a single type.
static Type dropM(Type type) SIP_HOLDGIL
Drops the m dimension (if present) for a WKB type and returns the new type.
static Type flatType(Type type) SIP_HOLDGIL
Returns the flat type for a WKB type.
static Type addZ(Type type) SIP_HOLDGIL
Adds the z dimension to a WKB type and returns the new type.
Type
The WKB type describes the number of dimensions a geometry has.
static Type multiType(Type type) SIP_HOLDGIL
Returns the multi type for a WKB type.
static int coordDimensions(Type type) SIP_HOLDGIL
Returns the coordinate dimension of the geometry type as an integer.
static Type parseType(const QString &wktStr)
Attempts to extract the WKB type from a WKT string.
static Type addM(Type type) SIP_HOLDGIL
Adds the m dimension to a WKB type and returns the new type.
static Type curveType(Type type) SIP_HOLDGIL
Returns the curve type for a WKB type.
static Type linearType(Type type) SIP_HOLDGIL
Returns the linear type for a WKB type.
static bool hasM(Type type) SIP_HOLDGIL
Tests whether a WKB type contains m values.
static Type zmType(Type type, bool hasZ, bool hasM) SIP_HOLDGIL
Returns the modified input geometry type according to hasZ / hasM.
static Type dropZ(Type type) SIP_HOLDGIL
Drops the z dimension (if present) for a WKB type and returns the new type.
static Type to25D(Type type) SIP_HOLDGIL
Will convert the 25D version of the flat type if supported or Unknown if not supported.
static bool isCurvedType(Type type) SIP_HOLDGIL
Returns true if the WKB type is a curved type or can contain curved geometries.
GeometryType
The geometry types are used to group QgsWkbTypes::Type in a coarse way.
static int wkbDimensions(Type type) SIP_HOLDGIL
Returns the inherent dimension of the geometry type as an integer.
static GeometryType geometryType(Type type) SIP_HOLDGIL
Returns the geometry type for a WKB type, e.g., both MultiPolygon and CurvePolygon would have a Polyg...
static bool hasZ(Type type) SIP_HOLDGIL
Tests whether a WKB type contains the z-dimension.
Handles storage of information regarding WKB types and their properties.
static bool isMultiType(Type type) SIP_HOLDGIL
Returns true if the WKB type is a multi type.