QGIS API Documentation  3.10.0-A Coruña (6c816b4204)
qgswkbtypes.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgswkbtypes.h
3  -----------------------
4  begin : January 2015
5  copyright : (C) 2015 by Marco Hugentobler
6  email : marco at sourcepole dot ch
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSWKBTYPES_H
19 #define QGSWKBTYPES_H
20 
21 #include <QObject>
22 #include <QMap>
23 #include <QString>
24 
25 #include "qgis_core.h"
26 
27 /***************************************************************************
28  * This class is considered CRITICAL and any change MUST be accompanied with
29  * full unit tests in testqgsstatisticalsummary.cpp.
30  * See details in QEP #17
31  ****************************************************************************/
32 
40 class CORE_EXPORT QgsWkbTypes
41 {
42  Q_GADGET
43  public:
44 
68  enum Type
69  {
70  Unknown = 0,
71  Point = 1,
72  LineString = 2,
73  Polygon = 3,
74  Triangle = 17,
75  MultiPoint = 4,
76  MultiLineString = 5,
77  MultiPolygon = 6,
78  GeometryCollection = 7,
79  CircularString = 8,
80  CompoundCurve = 9,
81  CurvePolygon = 10, //13, //should be 10. Seems to be correct in newer PostGIS versions
82  MultiCurve = 11,
83  MultiSurface = 12,
84  NoGeometry = 100, //attributes only
85  PointZ = 1001,
86  LineStringZ = 1002,
87  PolygonZ = 1003,
88  TriangleZ = 1017,
89  MultiPointZ = 1004,
90  MultiLineStringZ = 1005,
91  MultiPolygonZ = 1006,
92  GeometryCollectionZ = 1007,
93  CircularStringZ = 1008,
94  CompoundCurveZ = 1009,
95  CurvePolygonZ = 1010,
96  MultiCurveZ = 1011,
97  MultiSurfaceZ = 1012,
98  PointM = 2001,
99  LineStringM = 2002,
100  PolygonM = 2003,
101  TriangleM = 2017,
102  MultiPointM = 2004,
103  MultiLineStringM = 2005,
104  MultiPolygonM = 2006,
105  GeometryCollectionM = 2007,
106  CircularStringM = 2008,
107  CompoundCurveM = 2009,
108  CurvePolygonM = 2010,
109  MultiCurveM = 2011,
110  MultiSurfaceM = 2012,
111  PointZM = 3001,
112  LineStringZM = 3002,
113  PolygonZM = 3003,
114  MultiPointZM = 3004,
115  MultiLineStringZM = 3005,
116  MultiPolygonZM = 3006,
117  GeometryCollectionZM = 3007,
118  CircularStringZM = 3008,
119  CompoundCurveZM = 3009,
120  CurvePolygonZM = 3010,
121  MultiCurveZM = 3011,
122  MultiSurfaceZM = 3012,
123  TriangleZM = 3017,
124  Point25D = 0x80000001,
129  MultiPolygon25D
130  };
131  Q_ENUM( Type )
132 
133 
140  {
145  NullGeometry
146  };
147  Q_ENUM( GeometryType )
148 
149 
156  static Type singleType( Type type )
157  {
158  switch ( type )
159  {
160  case Unknown:
161  case GeometryCollection:
162  case GeometryCollectionZ:
163  case GeometryCollectionM:
164  case GeometryCollectionZM:
165  return Unknown;
166 
167  case Point:
168  case MultiPoint:
169  return Point;
170 
171  case PointZ:
172  case MultiPointZ:
173  return PointZ;
174 
175  case PointM:
176  case MultiPointM:
177  return PointM;
178 
179  case PointZM:
180  case MultiPointZM:
181  return PointZM;
182 
183  case LineString:
184  case MultiLineString:
185  return LineString;
186 
187  case LineStringZ:
188  case MultiLineStringZ:
189  return LineStringZ;
190 
191  case LineStringM:
192  case MultiLineStringM:
193  return LineStringM;
194 
195  case LineStringZM:
196  case MultiLineStringZM:
197  return LineStringZM;
198 
199  case Polygon:
200  case MultiPolygon:
201  return Polygon;
202 
203  case PolygonZ:
204  case MultiPolygonZ:
205  return PolygonZ;
206 
207  case PolygonM:
208  case MultiPolygonM:
209  return PolygonM;
210 
211  case PolygonZM:
212  case MultiPolygonZM:
213  return PolygonZM;
214 
215  case Triangle:
216  // case MultiTriangle:
217  return Triangle;
218 
219  case TriangleZ:
220  // case MultiTriangleZ:
221  return TriangleZ;
222 
223  case TriangleM:
224  // case MultiTriangleM:
225  return TriangleM;
226 
227  case TriangleZM:
228  // case MultiTriangleZM:
229  return TriangleZM;
230 
231  case CircularString:
232  return CircularString;
233 
234  case CircularStringZ:
235  return CircularStringZ;
236 
237  case CircularStringM:
238  return CircularStringM;
239 
240  case CircularStringZM:
241  return CircularStringZM;
242 
243  case CompoundCurve:
244  case MultiCurve:
245  return CompoundCurve;
246 
247  case CompoundCurveZ:
248  case MultiCurveZ:
249  return CompoundCurveZ;
250 
251  case CompoundCurveM:
252  case MultiCurveM:
253  return CompoundCurveM;
254 
255  case CompoundCurveZM:
256  case MultiCurveZM:
257  return CompoundCurveZM;
258 
259  case CurvePolygon:
260  case MultiSurface:
261  return CurvePolygon;
262 
263  case CurvePolygonZ:
264  case MultiSurfaceZ:
265  return CurvePolygonZ;
266 
267  case CurvePolygonM:
268  case MultiSurfaceM:
269  return CurvePolygonM;
270 
271  case CurvePolygonZM:
272  case MultiSurfaceZM:
273  return CurvePolygonZM;
274 
275  case NoGeometry:
276  return NoGeometry;
277 
278  case Point25D:
279  case MultiPoint25D:
280  return Point25D;
281 
282  case LineString25D:
283  case MultiLineString25D:
284  return LineString25D;
285 
286  case Polygon25D:
287  case MultiPolygon25D:
288  return Polygon25D;
289 
290  }
291  return Unknown;
292  }
293 
301  static Type multiType( Type type )
302  {
303  switch ( type )
304  {
305  case Unknown:
306  case Triangle:
307  case TriangleZ:
308  case TriangleM:
309  case TriangleZM:
310  return Unknown;
311 
312  case GeometryCollection:
313  return GeometryCollection;
314 
315  case GeometryCollectionZ:
316  return GeometryCollectionZ;
317 
318  case GeometryCollectionM:
319  return GeometryCollectionM;
320 
321  case GeometryCollectionZM:
322  return GeometryCollectionZM;
323 
324  case Point:
325  case MultiPoint:
326  return MultiPoint;
327 
328  case PointZ:
329  case MultiPointZ:
330  return MultiPointZ;
331 
332  case PointM:
333  case MultiPointM:
334  return MultiPointM;
335 
336  case PointZM:
337  case MultiPointZM:
338  return MultiPointZM;
339 
340  case LineString:
341  case MultiLineString:
342  return MultiLineString;
343 
344  case LineStringZ:
345  case MultiLineStringZ:
346  return MultiLineStringZ;
347 
348  case LineStringM:
349  case MultiLineStringM:
350  return MultiLineStringM;
351 
352  case LineStringZM:
353  case MultiLineStringZM:
354  return MultiLineStringZM;
355 
356  case Polygon:
357  case MultiPolygon:
358  return MultiPolygon;
359 
360  case PolygonZ:
361  case MultiPolygonZ:
362  return MultiPolygonZ;
363 
364  case PolygonM:
365  case MultiPolygonM:
366  return MultiPolygonM;
367 
368  case PolygonZM:
369  case MultiPolygonZM:
370  return MultiPolygonZM;
371 
372  case CompoundCurve:
373  case CircularString:
374  case MultiCurve:
375  return MultiCurve;
376 
377  case CompoundCurveZ:
378  case CircularStringZ:
379  case MultiCurveZ:
380  return MultiCurveZ;
381 
382  case CompoundCurveM:
383  case CircularStringM:
384  case MultiCurveM:
385  return MultiCurveM;
386 
387  case CompoundCurveZM:
388  case CircularStringZM:
389  case MultiCurveZM:
390  return MultiCurveZM;
391 
392  case CurvePolygon:
393  case MultiSurface:
394  return MultiSurface;
395 
396  case CurvePolygonZ:
397  case MultiSurfaceZ:
398  return MultiSurfaceZ;
399 
400  case CurvePolygonM:
401  case MultiSurfaceM:
402  return MultiSurfaceM;
403 
404  case CurvePolygonZM:
405  case MultiSurfaceZM:
406  return MultiSurfaceZM;
407 
408  case NoGeometry:
409  return NoGeometry;
410 
411  case Point25D:
412  case MultiPoint25D:
413  return MultiPoint25D;
414 
415  case LineString25D:
416  case MultiLineString25D:
417  return MultiLineString25D;
418 
419  case Polygon25D:
420  case MultiPolygon25D:
421  return MultiPolygon25D;
422  }
423  return Unknown;
424  }
425 
426 
440  static Type curveType( Type type )
441  {
442  switch ( type )
443  {
444  case Unknown:
445  case Triangle:
446  case TriangleZ:
447  case TriangleM:
448  case TriangleZM:
449  return Unknown;
450 
451  case GeometryCollection:
452  return GeometryCollection;
453 
454  case GeometryCollectionZ:
455  return GeometryCollectionZ;
456 
457  case GeometryCollectionM:
458  return GeometryCollectionM;
459 
460  case GeometryCollectionZM:
461  return GeometryCollectionZM;
462 
463  case Point:
464  return Point;
465 
466  case MultiPoint:
467  return MultiPoint;
468 
469  case PointZ:
470  return PointZ;
471 
472  case MultiPointZ:
473  return MultiPointZ;
474 
475  case PointM:
476  return PointM;
477 
478  case MultiPointM:
479  return MultiPointM;
480 
481  case PointZM:
482  return PointZM;
483 
484  case MultiPointZM:
485  return MultiPointZM;
486 
487  case LineString:
488  case CompoundCurve:
489  case CircularString:
490  return CompoundCurve;
491 
492  case MultiLineString:
493  case MultiCurve:
494  return MultiCurve;
495 
496  case LineStringZ:
497  case CompoundCurveZ:
498  case CircularStringZ:
499  case LineString25D:
500  return CompoundCurveZ;
501 
502  case MultiLineStringZ:
503  case MultiCurveZ:
504  case MultiLineString25D:
505  return MultiCurveZ;
506 
507  case LineStringM:
508  case CompoundCurveM:
509  case CircularStringM:
510  return CompoundCurveM;
511 
512  case MultiLineStringM:
513  case MultiCurveM:
514  return MultiCurveM;
515 
516  case LineStringZM:
517  case CompoundCurveZM:
518  case CircularStringZM:
519  return CompoundCurveZM;
520 
521  case MultiLineStringZM:
522  case MultiCurveZM:
523  return MultiCurveZM;
524 
525  case Polygon:
526  case CurvePolygon:
527  return CurvePolygon;
528 
529  case MultiPolygon:
530  case MultiSurface:
531  return MultiSurface;
532 
533  case PolygonZ:
534  case CurvePolygonZ:
535  case Polygon25D:
536  return CurvePolygonZ;
537 
538  case MultiPolygonZ:
539  case MultiSurfaceZ:
540  case MultiPolygon25D:
541  return MultiSurfaceZ;
542 
543  case PolygonM:
544  case CurvePolygonM:
545  return CurvePolygonM;
546 
547  case MultiPolygonM:
548  case MultiSurfaceM:
549  return MultiSurfaceM;
550 
551  case PolygonZM:
552  case CurvePolygonZM:
553  return CurvePolygonZM;
554 
555  case MultiPolygonZM:
556  case MultiSurfaceZM:
557  return MultiSurfaceZM;
558 
559  case NoGeometry:
560  return NoGeometry;
561 
562  case Point25D:
563  case MultiPoint25D:
564  return MultiPoint25D;
565  }
566  return Unknown;
567  }
568 
576  static Type flatType( Type type )
577  {
578  switch ( type )
579  {
580  case Unknown:
581  return Unknown;
582 
583  case Point:
584  case PointZ:
585  case PointM:
586  case PointZM:
587  case Point25D:
588  return Point;
589 
590  case LineString:
591  case LineStringZ:
592  case LineStringM:
593  case LineStringZM:
594  case LineString25D:
595  return LineString;
596 
597  case Polygon:
598  case PolygonZ:
599  case PolygonM:
600  case PolygonZM:
601  case Polygon25D:
602  return Polygon;
603 
604  case Triangle:
605  case TriangleZ:
606  case TriangleM:
607  case TriangleZM:
608  return Triangle;
609 
610  case MultiPoint:
611  case MultiPointZ:
612  case MultiPointM:
613  case MultiPointZM:
614  case MultiPoint25D:
615  return MultiPoint;
616 
617  case MultiLineString:
618  case MultiLineStringZ:
619  case MultiLineStringM:
620  case MultiLineStringZM:
621  case MultiLineString25D:
622  return MultiLineString;
623 
624  case MultiPolygon:
625  case MultiPolygonZ:
626  case MultiPolygonM:
627  case MultiPolygonZM:
628  case MultiPolygon25D:
629  return MultiPolygon;
630 
631  case GeometryCollection:
632  case GeometryCollectionZ:
633  case GeometryCollectionM:
634  case GeometryCollectionZM:
635  return GeometryCollection;
636 
637  case CircularString:
638  case CircularStringZ:
639  case CircularStringM:
640  case CircularStringZM:
641  return CircularString;
642 
643  case CompoundCurve:
644  case CompoundCurveZ:
645  case CompoundCurveM:
646  case CompoundCurveZM:
647  return CompoundCurve;
648 
649  case MultiCurve:
650  case MultiCurveZ:
651  case MultiCurveM:
652  case MultiCurveZM:
653  return MultiCurve;
654 
655  case CurvePolygon:
656  case CurvePolygonZ:
657  case CurvePolygonM:
658  case CurvePolygonZM:
659  return CurvePolygon;
660 
661  case MultiSurface:
662  case MultiSurfaceZ:
663  case MultiSurfaceM:
664  case MultiSurfaceZM:
665  return MultiSurface;
666 
667  case NoGeometry:
668  return NoGeometry;
669 
670  }
671  return Unknown;
672  }
673 
675  static Type zmType( Type type, bool hasZ, bool hasM )
676  {
677  type = flatType( type );
678  if ( hasZ )
679  type = static_cast<QgsWkbTypes::Type>( static_cast<quint32>( type ) + 1000 );
680  if ( hasM )
681  type = static_cast<QgsWkbTypes::Type>( static_cast<quint32>( type ) + 2000 );
682  return type;
683  }
684 
689  static Type parseType( const QString &wktStr );
690 
696  static bool isSingleType( Type type )
697  {
698  return ( type != Unknown && !isMultiType( type ) );
699  }
700 
706  static bool isMultiType( Type type )
707  {
708  switch ( type )
709  {
710  case Unknown:
711  case Point:
712  case LineString:
713  case Polygon:
714  case Triangle:
715  case CircularString:
716  case CompoundCurve:
717  case CurvePolygon:
718  case NoGeometry:
719  case PointZ:
720  case LineStringZ:
721  case PolygonZ:
722  case TriangleZ:
723  case CircularStringZ:
724  case CompoundCurveZ:
725  case CurvePolygonZ:
726  case PointM:
727  case LineStringM:
728  case PolygonM:
729  case TriangleM:
730  case CircularStringM:
731  case CompoundCurveM:
732  case CurvePolygonM:
733  case PointZM:
734  case LineStringZM:
735  case PolygonZM:
736  case TriangleZM:
737  case CircularStringZM:
738  case CompoundCurveZM:
739  case CurvePolygonZM:
740  case Point25D:
741  case LineString25D:
742  case Polygon25D:
743  return false;
744 
745  default:
746  return true;
747 
748  }
749  }
750 
755  static bool isCurvedType( Type type )
756  {
757  switch ( flatType( type ) )
758  {
759  case CircularString:
760  case CompoundCurve:
761  case CurvePolygon:
762  case MultiCurve:
763  case MultiSurface:
764  return true;
765 
766  default:
767  return false;
768  }
769  }
770 
778  static int wkbDimensions( Type type )
779  {
780  GeometryType gtype = geometryType( type );
781  switch ( gtype )
782  {
783  case LineGeometry:
784  return 1;
785  case PolygonGeometry:
786  return 2;
787  default: //point, no geometry, unknown geometry
788  return 0;
789  }
790  }
791 
799  static int coordDimensions( Type type )
800  {
801  if ( type == Unknown || type == NoGeometry )
802  return 0;
803 
804  return 2 + hasZ( type ) + hasM( type );
805  }
806 
813  {
814  switch ( type )
815  {
816  case Unknown:
817  case GeometryCollection:
818  case GeometryCollectionZ:
819  case GeometryCollectionM:
820  case GeometryCollectionZM:
821  return UnknownGeometry;
822 
823  case Point:
824  case MultiPoint:
825  case PointZ:
826  case MultiPointZ:
827  case PointM:
828  case MultiPointM:
829  case PointZM:
830  case MultiPointZM:
831  case Point25D:
832  case MultiPoint25D:
833  return PointGeometry;
834 
835  case LineString:
836  case MultiLineString:
837  case LineStringZ:
838  case MultiLineStringZ:
839  case LineStringM:
840  case MultiLineStringM:
841  case LineStringZM:
842  case MultiLineStringZM:
843  case LineString25D:
844  case MultiLineString25D:
845  case CircularString:
846  case CompoundCurve:
847  case MultiCurve:
848  case CircularStringZ:
849  case CompoundCurveZ:
850  case MultiCurveZ:
851  case CircularStringM:
852  case CompoundCurveM:
853  case MultiCurveM:
854  case CircularStringZM:
855  case CompoundCurveZM:
856  case MultiCurveZM:
857  return LineGeometry;
858 
859  case Polygon:
860  case MultiPolygon:
861  case Triangle:
862  case PolygonZ:
863  case TriangleZ:
864  case MultiPolygonZ:
865  case PolygonM:
866  case TriangleM:
867  case MultiPolygonM:
868  case PolygonZM:
869  case MultiPolygonZM:
870  case TriangleZM:
871  case Polygon25D:
872  case MultiPolygon25D:
873  case CurvePolygon:
874  case MultiSurface:
875  case CurvePolygonZ:
876  case MultiSurfaceZ:
877  case CurvePolygonM:
878  case MultiSurfaceM:
879  case CurvePolygonZM:
880  case MultiSurfaceZM:
881  return PolygonGeometry;
882 
883  case NoGeometry:
884  return NullGeometry;
885  }
886 
887  return UnknownGeometry;
888  }
889 
893  static QString displayString( Type type );
894 
909  static QString geometryDisplayString( GeometryType type );
910 
917  static bool hasZ( Type type )
918  {
919  switch ( type )
920  {
921  case PointZ:
922  case LineStringZ:
923  case PolygonZ:
924  case TriangleZ:
925  case MultiPointZ:
926  case MultiLineStringZ:
927  case MultiPolygonZ:
928  case GeometryCollectionZ:
929  case CircularStringZ:
930  case CompoundCurveZ:
931  case CurvePolygonZ:
932  case MultiCurveZ:
933  case MultiSurfaceZ:
934  case PointZM:
935  case LineStringZM:
936  case PolygonZM:
937  case TriangleZM:
938  case MultiPointZM:
939  case MultiLineStringZM:
940  case MultiPolygonZM:
941  case GeometryCollectionZM:
942  case CircularStringZM:
943  case CompoundCurveZM:
944  case CurvePolygonZM:
945  case MultiCurveZM:
946  case MultiSurfaceZM:
947  case Point25D:
948  case LineString25D:
949  case Polygon25D:
950  case MultiPoint25D:
951  case MultiLineString25D:
952  case MultiPolygon25D:
953  return true;
954 
955  default:
956  return false;
957 
958  }
959  }
960 
967  static bool hasM( Type type )
968  {
969  switch ( type )
970  {
971  case PointM:
972  case LineStringM:
973  case PolygonM:
974  case TriangleM:
975  case MultiPointM:
976  case MultiLineStringM:
977  case MultiPolygonM:
978  case GeometryCollectionM:
979  case CircularStringM:
980  case CompoundCurveM:
981  case CurvePolygonM:
982  case MultiCurveM:
983  case MultiSurfaceM:
984  case PointZM:
985  case LineStringZM:
986  case PolygonZM:
987  case TriangleZM:
988  case MultiPointZM:
989  case MultiLineStringZM:
990  case MultiPolygonZM:
991  case GeometryCollectionZM:
992  case CircularStringZM:
993  case CompoundCurveZM:
994  case CurvePolygonZM:
995  case MultiCurveZM:
996  case MultiSurfaceZM:
997  return true;
998 
999  default:
1000  return false;
1001 
1002  }
1003  }
1004 
1013  static Type addZ( Type type )
1014  {
1015  if ( hasZ( type ) )
1016  return type;
1017  else if ( type == Unknown )
1018  return Unknown;
1019  else if ( type == NoGeometry )
1020  return NoGeometry;
1021 
1022  //upgrade with z dimension
1023  Type flat = flatType( type );
1024  if ( hasM( type ) )
1025  return static_cast< QgsWkbTypes::Type >( flat + 3000 );
1026  else
1027  return static_cast< QgsWkbTypes::Type >( flat + 1000 );
1028  }
1029 
1038  static Type addM( Type type )
1039  {
1040  if ( hasM( type ) )
1041  return type;
1042  else if ( type == Unknown )
1043  return Unknown;
1044  else if ( type == NoGeometry )
1045  return NoGeometry;
1046  else if ( type == Point25D ||
1047  type == LineString25D ||
1048  type == Polygon25D ||
1049  type == MultiPoint25D ||
1050  type == MultiLineString25D ||
1051  type == MultiPolygon25D )
1052  return type; //can't add M dimension to these types
1053 
1054  //upgrade with m dimension
1055  Type flat = flatType( type );
1056  if ( hasZ( type ) )
1057  return static_cast< QgsWkbTypes::Type >( flat + 3000 );
1058  else
1059  return static_cast< QgsWkbTypes::Type >( flat + 2000 );
1060  }
1061 
1069  static Type dropZ( Type type )
1070  {
1071  if ( !hasZ( type ) )
1072  return type;
1073 
1074  QgsWkbTypes::Type returnType = flatType( type );
1075  if ( hasM( type ) )
1076  returnType = addM( returnType );
1077  return returnType;
1078  }
1079 
1087  static Type dropM( Type type )
1088  {
1089  if ( !hasM( type ) )
1090  return type;
1091 
1092  QgsWkbTypes::Type returnType = flatType( type );
1093  if ( hasZ( type ) )
1094  returnType = addZ( returnType );
1095  return returnType;
1096  }
1097 
1103  static Type to25D( Type type )
1104  {
1105  QgsWkbTypes::Type flat = flatType( type );
1106 
1107  if ( flat >= Point && flat <= MultiPolygon )
1108  return static_cast< QgsWkbTypes::Type >( flat + 0x80000000 );
1109  else if ( type == QgsWkbTypes::NoGeometry )
1110  return QgsWkbTypes::NoGeometry;
1111  else
1112  return Unknown;
1113  }
1114 
1115  private:
1116 
1117  struct wkbEntry
1118  {
1119  wkbEntry( const QString &name, bool isMultiType, Type multiType, Type singleType, Type flatType, GeometryType geometryType,
1120  bool hasZ, bool hasM )
1121  : mName( name )
1122  , mIsMultiType( isMultiType )
1123  , mMultiType( multiType )
1124  , mSingleType( singleType )
1125  , mFlatType( flatType )
1126  , mGeometryType( geometryType )
1127  , mHasZ( hasZ )
1128  , mHasM( hasM )
1129  {}
1130  QString mName;
1131  bool mIsMultiType;
1132  Type mMultiType;
1133  Type mSingleType;
1134  Type mFlatType;
1135  GeometryType mGeometryType;
1136  bool mHasZ;
1137  bool mHasM;
1138  };
1139 
1140  static const QMap<Type, wkbEntry> ENTRIES;
1141 };
1142 
1143 #endif // QGSWKBTYPES_H
static Type to25D(Type type)
Will convert the 25D version of the flat type if supported or Unknown if not supported.
Definition: qgswkbtypes.h:1103
static Type multiType(Type type)
Returns the multi type for a WKB type.
Definition: qgswkbtypes.h:301
static int wkbDimensions(Type type)
Returns the inherent dimension of the geometry type as an integer.
Definition: qgswkbtypes.h:778
static bool isMultiType(Type type)
Returns true if the WKB type is a multi type.
Definition: qgswkbtypes.h:706
Handles storage of information regarding WKB types and their properties.
Definition: qgswkbtypes.h:40
static bool hasZ(Type type)
Tests whether a WKB type contains the z-dimension.
Definition: qgswkbtypes.h:917
static Type dropM(Type type)
Drops the m dimension (if present) for a WKB type and returns the new type.
Definition: qgswkbtypes.h:1087
Type
The WKB type describes the number of dimensions a geometry has.
Definition: qgswkbtypes.h:68
static Type addM(Type type)
Adds the m dimension to a WKB type and returns the new type.
Definition: qgswkbtypes.h:1038
static GeometryType geometryType(Type type)
Returns the geometry type for a WKB type, e.g., both MultiPolygon and CurvePolygon would have a Polyg...
Definition: qgswkbtypes.h:812
static Type addZ(Type type)
Adds the z dimension to a WKB type and returns the new type.
Definition: qgswkbtypes.h:1013
static bool isSingleType(Type type)
Returns true if the WKB type is a single type.
Definition: qgswkbtypes.h:696
GeometryType
The geometry types are used to group QgsWkbTypes::Type in a coarse way.
Definition: qgswkbtypes.h:139
static Type dropZ(Type type)
Drops the z dimension (if present) for a WKB type and returns the new type.
Definition: qgswkbtypes.h:1069
static Type curveType(Type type)
Returns the curve type for a WKB type.
Definition: qgswkbtypes.h:440
static bool isCurvedType(Type type)
Returns true if the WKB type is a curved type or can contain curved geometries.
Definition: qgswkbtypes.h:755
static Type zmType(Type type, bool hasZ, bool hasM)
Returns the modified input geometry type according to hasZ / hasM.
Definition: qgswkbtypes.h:675
static bool hasM(Type type)
Tests whether a WKB type contains m values.
Definition: qgswkbtypes.h:967
static Type flatType(Type type)
Returns the flat type for a WKB type.
Definition: qgswkbtypes.h:576
static int coordDimensions(Type type)
Returns the coordinate dimension of the geometry type as an integer.
Definition: qgswkbtypes.h:799