QGIS API Documentation  3.4.15-Madeira (e83d02e274)
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 
139  {
144  NullGeometry
145  };
146  Q_ENUM( GeometryType )
147 
148 
154  static Type singleType( Type type )
155  {
156  switch ( type )
157  {
158  case Unknown:
159  case GeometryCollection:
160  case GeometryCollectionZ:
161  case GeometryCollectionM:
162  case GeometryCollectionZM:
163  return Unknown;
164 
165  case Point:
166  case MultiPoint:
167  return Point;
168 
169  case PointZ:
170  case MultiPointZ:
171  return PointZ;
172 
173  case PointM:
174  case MultiPointM:
175  return PointM;
176 
177  case PointZM:
178  case MultiPointZM:
179  return PointZM;
180 
181  case LineString:
182  case MultiLineString:
183  return LineString;
184 
185  case LineStringZ:
186  case MultiLineStringZ:
187  return LineStringZ;
188 
189  case LineStringM:
190  case MultiLineStringM:
191  return LineStringM;
192 
193  case LineStringZM:
194  case MultiLineStringZM:
195  return LineStringZM;
196 
197  case Polygon:
198  case MultiPolygon:
199  return Polygon;
200 
201  case PolygonZ:
202  case MultiPolygonZ:
203  return PolygonZ;
204 
205  case PolygonM:
206  case MultiPolygonM:
207  return PolygonM;
208 
209  case PolygonZM:
210  case MultiPolygonZM:
211  return PolygonZM;
212 
213  case Triangle:
214  // case MultiTriangle:
215  return Triangle;
216 
217  case TriangleZ:
218  // case MultiTriangleZ:
219  return TriangleZ;
220 
221  case TriangleM:
222  // case MultiTriangleM:
223  return TriangleM;
224 
225  case TriangleZM:
226  // case MultiTriangleZM:
227  return TriangleZM;
228 
229  case CircularString:
230  return CircularString;
231 
232  case CircularStringZ:
233  return CircularStringZ;
234 
235  case CircularStringM:
236  return CircularStringM;
237 
238  case CircularStringZM:
239  return CircularStringZM;
240 
241  case CompoundCurve:
242  case MultiCurve:
243  return CompoundCurve;
244 
245  case CompoundCurveZ:
246  case MultiCurveZ:
247  return CompoundCurveZ;
248 
249  case CompoundCurveM:
250  case MultiCurveM:
251  return CompoundCurveM;
252 
253  case CompoundCurveZM:
254  case MultiCurveZM:
255  return CompoundCurveZM;
256 
257  case CurvePolygon:
258  case MultiSurface:
259  return CurvePolygon;
260 
261  case CurvePolygonZ:
262  case MultiSurfaceZ:
263  return CurvePolygonZ;
264 
265  case CurvePolygonM:
266  case MultiSurfaceM:
267  return CurvePolygonM;
268 
269  case CurvePolygonZM:
270  case MultiSurfaceZM:
271  return CurvePolygonZM;
272 
273  case NoGeometry:
274  return NoGeometry;
275 
276  case Point25D:
277  case MultiPoint25D:
278  return Point25D;
279 
280  case LineString25D:
281  case MultiLineString25D:
282  return LineString25D;
283 
284  case Polygon25D:
285  case MultiPolygon25D:
286  return Polygon25D;
287 
288  }
289  return Unknown;
290  }
291 
298  static Type multiType( Type type )
299  {
300  switch ( type )
301  {
302  case Unknown:
303  case Triangle:
304  case TriangleZ:
305  case TriangleM:
306  case TriangleZM:
307  return Unknown;
308 
309  case GeometryCollection:
310  return GeometryCollection;
311 
312  case GeometryCollectionZ:
313  return GeometryCollectionZ;
314 
315  case GeometryCollectionM:
316  return GeometryCollectionM;
317 
318  case GeometryCollectionZM:
319  return GeometryCollectionZM;
320 
321  case Point:
322  case MultiPoint:
323  return MultiPoint;
324 
325  case PointZ:
326  case MultiPointZ:
327  return MultiPointZ;
328 
329  case PointM:
330  case MultiPointM:
331  return MultiPointM;
332 
333  case PointZM:
334  case MultiPointZM:
335  return MultiPointZM;
336 
337  case LineString:
338  case MultiLineString:
339  return MultiLineString;
340 
341  case LineStringZ:
342  case MultiLineStringZ:
343  return MultiLineStringZ;
344 
345  case LineStringM:
346  case MultiLineStringM:
347  return MultiLineStringM;
348 
349  case LineStringZM:
350  case MultiLineStringZM:
351  return MultiLineStringZM;
352 
353  case Polygon:
354  case MultiPolygon:
355  return MultiPolygon;
356 
357  case PolygonZ:
358  case MultiPolygonZ:
359  return MultiPolygonZ;
360 
361  case PolygonM:
362  case MultiPolygonM:
363  return MultiPolygonM;
364 
365  case PolygonZM:
366  case MultiPolygonZM:
367  return MultiPolygonZM;
368 
369  case CompoundCurve:
370  case CircularString:
371  case MultiCurve:
372  return MultiCurve;
373 
374  case CompoundCurveZ:
375  case CircularStringZ:
376  case MultiCurveZ:
377  return MultiCurveZ;
378 
379  case CompoundCurveM:
380  case CircularStringM:
381  case MultiCurveM:
382  return MultiCurveM;
383 
384  case CompoundCurveZM:
385  case CircularStringZM:
386  case MultiCurveZM:
387  return MultiCurveZM;
388 
389  case CurvePolygon:
390  case MultiSurface:
391  return MultiSurface;
392 
393  case CurvePolygonZ:
394  case MultiSurfaceZ:
395  return MultiSurfaceZ;
396 
397  case CurvePolygonM:
398  case MultiSurfaceM:
399  return MultiSurfaceM;
400 
401  case CurvePolygonZM:
402  case MultiSurfaceZM:
403  return MultiSurfaceZM;
404 
405  case NoGeometry:
406  return NoGeometry;
407 
408  case Point25D:
409  case MultiPoint25D:
410  return MultiPoint25D;
411 
412  case LineString25D:
413  case MultiLineString25D:
414  return MultiLineString25D;
415 
416  case Polygon25D:
417  case MultiPolygon25D:
418  return MultiPolygon25D;
419  }
420  return Unknown;
421  }
422 
423 
430  static Type curveType( Type type )
431  {
432  switch ( type )
433  {
434  case Unknown:
435  case Triangle:
436  case TriangleZ:
437  case TriangleM:
438  case TriangleZM:
439  return Unknown;
440 
441  case GeometryCollection:
442  return GeometryCollection;
443 
444  case GeometryCollectionZ:
445  return GeometryCollectionZ;
446 
447  case GeometryCollectionM:
448  return GeometryCollectionM;
449 
450  case GeometryCollectionZM:
451  return GeometryCollectionZM;
452 
453  case Point:
454  return Point;
455 
456  case MultiPoint:
457  return MultiPoint;
458 
459  case PointZ:
460  return PointZ;
461 
462  case MultiPointZ:
463  return MultiPointZ;
464 
465  case PointM:
466  return PointM;
467 
468  case MultiPointM:
469  return MultiPointM;
470 
471  case PointZM:
472  return PointZM;
473 
474  case MultiPointZM:
475  return MultiPointZM;
476 
477  case LineString:
478  case CompoundCurve:
479  case CircularString:
480  return CompoundCurve;
481 
482  case MultiLineString:
483  case MultiCurve:
484  return MultiCurve;
485 
486  case LineStringZ:
487  case CompoundCurveZ:
488  case CircularStringZ:
489  case LineString25D:
490  return CompoundCurveZ;
491 
492  case MultiLineStringZ:
493  case MultiCurveZ:
494  case MultiLineString25D:
495  return MultiCurveZ;
496 
497  case LineStringM:
498  case CompoundCurveM:
499  case CircularStringM:
500  return CompoundCurveM;
501 
502  case MultiLineStringM:
503  case MultiCurveM:
504  return MultiCurveM;
505 
506  case LineStringZM:
507  case CompoundCurveZM:
508  case CircularStringZM:
509  return CompoundCurveZM;
510 
511  case MultiLineStringZM:
512  case MultiCurveZM:
513  return MultiCurveZM;
514 
515  case Polygon:
516  case CurvePolygon:
517  return CurvePolygon;
518 
519  case MultiPolygon:
520  case MultiSurface:
521  return MultiSurface;
522 
523  case PolygonZ:
524  case CurvePolygonZ:
525  case Polygon25D:
526  return CurvePolygonZ;
527 
528  case MultiPolygonZ:
529  case MultiSurfaceZ:
530  case MultiPolygon25D:
531  return MultiSurfaceZ;
532 
533  case PolygonM:
534  case CurvePolygonM:
535  return CurvePolygonM;
536 
537  case MultiPolygonM:
538  case MultiSurfaceM:
539  return MultiSurfaceM;
540 
541  case PolygonZM:
542  case CurvePolygonZM:
543  return CurvePolygonZM;
544 
545  case MultiPolygonZM:
546  case MultiSurfaceZM:
547  return MultiSurfaceZM;
548 
549  case NoGeometry:
550  return NoGeometry;
551 
552  case Point25D:
553  case MultiPoint25D:
554  return MultiPoint25D;
555  }
556  return Unknown;
557  }
558 
565  static Type flatType( Type type )
566  {
567  switch ( type )
568  {
569  case Unknown:
570  return Unknown;
571 
572  case Point:
573  case PointZ:
574  case PointM:
575  case PointZM:
576  case Point25D:
577  return Point;
578 
579  case LineString:
580  case LineStringZ:
581  case LineStringM:
582  case LineStringZM:
583  case LineString25D:
584  return LineString;
585 
586  case Polygon:
587  case PolygonZ:
588  case PolygonM:
589  case PolygonZM:
590  case Polygon25D:
591  return Polygon;
592 
593  case Triangle:
594  case TriangleZ:
595  case TriangleM:
596  case TriangleZM:
597  return Triangle;
598 
599  case MultiPoint:
600  case MultiPointZ:
601  case MultiPointM:
602  case MultiPointZM:
603  case MultiPoint25D:
604  return MultiPoint;
605 
606  case MultiLineString:
607  case MultiLineStringZ:
608  case MultiLineStringM:
609  case MultiLineStringZM:
610  case MultiLineString25D:
611  return MultiLineString;
612 
613  case MultiPolygon:
614  case MultiPolygonZ:
615  case MultiPolygonM:
616  case MultiPolygonZM:
617  case MultiPolygon25D:
618  return MultiPolygon;
619 
620  case GeometryCollection:
621  case GeometryCollectionZ:
622  case GeometryCollectionM:
623  case GeometryCollectionZM:
624  return GeometryCollection;
625 
626  case CircularString:
627  case CircularStringZ:
628  case CircularStringM:
629  case CircularStringZM:
630  return CircularString;
631 
632  case CompoundCurve:
633  case CompoundCurveZ:
634  case CompoundCurveM:
635  case CompoundCurveZM:
636  return CompoundCurve;
637 
638  case MultiCurve:
639  case MultiCurveZ:
640  case MultiCurveM:
641  case MultiCurveZM:
642  return MultiCurve;
643 
644  case CurvePolygon:
645  case CurvePolygonZ:
646  case CurvePolygonM:
647  case CurvePolygonZM:
648  return CurvePolygon;
649 
650  case MultiSurface:
651  case MultiSurfaceZ:
652  case MultiSurfaceM:
653  case MultiSurfaceZM:
654  return MultiSurface;
655 
656  case NoGeometry:
657  return NoGeometry;
658 
659  }
660  return Unknown;
661  }
662 
664  static Type zmType( Type type, bool hasZ, bool hasM )
665  {
666  type = flatType( type );
667  if ( hasZ )
668  type = static_cast<QgsWkbTypes::Type>( static_cast<quint32>( type ) + 1000 );
669  if ( hasM )
670  type = static_cast<QgsWkbTypes::Type>( static_cast<quint32>( type ) + 2000 );
671  return type;
672  }
673 
678  static Type parseType( const QString &wktStr );
679 
685  static bool isSingleType( Type type )
686  {
687  return ( type != Unknown && !isMultiType( type ) );
688  }
689 
695  static bool isMultiType( Type type )
696  {
697  switch ( type )
698  {
699  case Unknown:
700  case Point:
701  case LineString:
702  case Polygon:
703  case Triangle:
704  case CircularString:
705  case CompoundCurve:
706  case CurvePolygon:
707  case NoGeometry:
708  case PointZ:
709  case LineStringZ:
710  case PolygonZ:
711  case TriangleZ:
712  case CircularStringZ:
713  case CompoundCurveZ:
714  case CurvePolygonZ:
715  case PointM:
716  case LineStringM:
717  case PolygonM:
718  case TriangleM:
719  case CircularStringM:
720  case CompoundCurveM:
721  case CurvePolygonM:
722  case PointZM:
723  case LineStringZM:
724  case PolygonZM:
725  case TriangleZM:
726  case CircularStringZM:
727  case CompoundCurveZM:
728  case CurvePolygonZM:
729  case Point25D:
730  case LineString25D:
731  case Polygon25D:
732  return false;
733 
734  default:
735  return true;
736 
737  }
738  }
739 
744  static bool isCurvedType( Type type )
745  {
746  switch ( flatType( type ) )
747  {
748  case CircularString:
749  case CompoundCurve:
750  case CurvePolygon:
751  case MultiCurve:
752  case MultiSurface:
753  return true;
754 
755  default:
756  return false;
757  }
758  }
759 
767  static int wkbDimensions( Type type )
768  {
769  GeometryType gtype = geometryType( type );
770  switch ( gtype )
771  {
772  case LineGeometry:
773  return 1;
774  case PolygonGeometry:
775  return 2;
776  default: //point, no geometry, unknown geometry
777  return 0;
778  }
779  }
780 
788  static int coordDimensions( Type type )
789  {
790  if ( type == Unknown || type == NoGeometry )
791  return 0;
792 
793  return 2 + hasZ( type ) + hasM( type );
794  }
795 
802  {
803  switch ( type )
804  {
805  case Unknown:
806  case GeometryCollection:
807  case GeometryCollectionZ:
808  case GeometryCollectionM:
809  case GeometryCollectionZM:
810  return UnknownGeometry;
811 
812  case Point:
813  case MultiPoint:
814  case PointZ:
815  case MultiPointZ:
816  case PointM:
817  case MultiPointM:
818  case PointZM:
819  case MultiPointZM:
820  case Point25D:
821  case MultiPoint25D:
822  return PointGeometry;
823 
824  case LineString:
825  case MultiLineString:
826  case LineStringZ:
827  case MultiLineStringZ:
828  case LineStringM:
829  case MultiLineStringM:
830  case LineStringZM:
831  case MultiLineStringZM:
832  case LineString25D:
833  case MultiLineString25D:
834  case CircularString:
835  case CompoundCurve:
836  case MultiCurve:
837  case CircularStringZ:
838  case CompoundCurveZ:
839  case MultiCurveZ:
840  case CircularStringM:
841  case CompoundCurveM:
842  case MultiCurveM:
843  case CircularStringZM:
844  case CompoundCurveZM:
845  case MultiCurveZM:
846  return LineGeometry;
847 
848  case Polygon:
849  case MultiPolygon:
850  case Triangle:
851  case PolygonZ:
852  case TriangleZ:
853  case MultiPolygonZ:
854  case PolygonM:
855  case TriangleM:
856  case MultiPolygonM:
857  case PolygonZM:
858  case MultiPolygonZM:
859  case TriangleZM:
860  case Polygon25D:
861  case MultiPolygon25D:
862  case CurvePolygon:
863  case MultiSurface:
864  case CurvePolygonZ:
865  case MultiSurfaceZ:
866  case CurvePolygonM:
867  case MultiSurfaceM:
868  case CurvePolygonZM:
869  case MultiSurfaceZM:
870  return PolygonGeometry;
871 
872  case NoGeometry:
873  return NullGeometry;
874  }
875 
876  return UnknownGeometry;
877  }
878 
882  static QString displayString( Type type );
883 
898  static QString geometryDisplayString( GeometryType type );
899 
906  static bool hasZ( Type type )
907  {
908  switch ( type )
909  {
910  case PointZ:
911  case LineStringZ:
912  case PolygonZ:
913  case TriangleZ:
914  case MultiPointZ:
915  case MultiLineStringZ:
916  case MultiPolygonZ:
917  case GeometryCollectionZ:
918  case CircularStringZ:
919  case CompoundCurveZ:
920  case CurvePolygonZ:
921  case MultiCurveZ:
922  case MultiSurfaceZ:
923  case PointZM:
924  case LineStringZM:
925  case PolygonZM:
926  case TriangleZM:
927  case MultiPointZM:
928  case MultiLineStringZM:
929  case MultiPolygonZM:
930  case GeometryCollectionZM:
931  case CircularStringZM:
932  case CompoundCurveZM:
933  case CurvePolygonZM:
934  case MultiCurveZM:
935  case MultiSurfaceZM:
936  case Point25D:
937  case LineString25D:
938  case Polygon25D:
939  case MultiPoint25D:
940  case MultiLineString25D:
941  case MultiPolygon25D:
942  return true;
943 
944  default:
945  return false;
946 
947  }
948  }
949 
956  static bool hasM( Type type )
957  {
958  switch ( type )
959  {
960  case PointM:
961  case LineStringM:
962  case PolygonM:
963  case TriangleM:
964  case MultiPointM:
965  case MultiLineStringM:
966  case MultiPolygonM:
967  case GeometryCollectionM:
968  case CircularStringM:
969  case CompoundCurveM:
970  case CurvePolygonM:
971  case MultiCurveM:
972  case MultiSurfaceM:
973  case PointZM:
974  case LineStringZM:
975  case PolygonZM:
976  case TriangleZM:
977  case MultiPointZM:
978  case MultiLineStringZM:
979  case MultiPolygonZM:
980  case GeometryCollectionZM:
981  case CircularStringZM:
982  case CompoundCurveZM:
983  case CurvePolygonZM:
984  case MultiCurveZM:
985  case MultiSurfaceZM:
986  return true;
987 
988  default:
989  return false;
990 
991  }
992  }
993 
1002  static Type addZ( Type type )
1003  {
1004  if ( hasZ( type ) )
1005  return type;
1006  else if ( type == Unknown )
1007  return Unknown;
1008  else if ( type == NoGeometry )
1009  return NoGeometry;
1010 
1011  //upgrade with z dimension
1012  Type flat = flatType( type );
1013  if ( hasM( type ) )
1014  return static_cast< QgsWkbTypes::Type >( flat + 3000 );
1015  else
1016  return static_cast< QgsWkbTypes::Type >( flat + 1000 );
1017  }
1018 
1027  static Type addM( Type type )
1028  {
1029  if ( hasM( type ) )
1030  return type;
1031  else if ( type == Unknown )
1032  return Unknown;
1033  else if ( type == NoGeometry )
1034  return NoGeometry;
1035  else if ( type == Point25D ||
1036  type == LineString25D ||
1037  type == Polygon25D ||
1038  type == MultiPoint25D ||
1039  type == MultiLineString25D ||
1040  type == MultiPolygon25D )
1041  return type; //can't add M dimension to these types
1042 
1043  //upgrade with m dimension
1044  Type flat = flatType( type );
1045  if ( hasZ( type ) )
1046  return static_cast< QgsWkbTypes::Type >( flat + 3000 );
1047  else
1048  return static_cast< QgsWkbTypes::Type >( flat + 2000 );
1049  }
1050 
1058  static Type dropZ( Type type )
1059  {
1060  if ( !hasZ( type ) )
1061  return type;
1062 
1063  QgsWkbTypes::Type returnType = flatType( type );
1064  if ( hasM( type ) )
1065  returnType = addM( returnType );
1066  return returnType;
1067  }
1068 
1076  static Type dropM( Type type )
1077  {
1078  if ( !hasM( type ) )
1079  return type;
1080 
1081  QgsWkbTypes::Type returnType = flatType( type );
1082  if ( hasZ( type ) )
1083  returnType = addZ( returnType );
1084  return returnType;
1085  }
1086 
1092  static Type to25D( Type type )
1093  {
1094  QgsWkbTypes::Type flat = flatType( type );
1095 
1096  if ( flat >= Point && flat <= MultiPolygon )
1097  return static_cast< QgsWkbTypes::Type >( flat + 0x80000000 );
1098  else if ( type == QgsWkbTypes::NoGeometry )
1099  return QgsWkbTypes::NoGeometry;
1100  else
1101  return Unknown;
1102  }
1103 
1104  private:
1105 
1106  struct wkbEntry
1107  {
1108  wkbEntry( const QString &name, bool isMultiType, Type multiType, Type singleType, Type flatType, GeometryType geometryType,
1109  bool hasZ, bool hasM )
1110  : mName( name )
1111  , mIsMultiType( isMultiType )
1112  , mMultiType( multiType )
1113  , mSingleType( singleType )
1114  , mFlatType( flatType )
1115  , mGeometryType( geometryType )
1116  , mHasZ( hasZ )
1117  , mHasM( hasM )
1118  {}
1119  QString mName;
1120  bool mIsMultiType;
1121  Type mMultiType;
1122  Type mSingleType;
1123  Type mFlatType;
1124  GeometryType mGeometryType;
1125  bool mHasZ;
1126  bool mHasM;
1127  };
1128 
1129  static const QMap<Type, wkbEntry> ENTRIES;
1130 };
1131 
1132 #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:1092
static Type multiType(Type type)
Returns the multi type for a WKB type.
Definition: qgswkbtypes.h:298
static int wkbDimensions(Type type)
Returns the inherent dimension of the geometry type as an integer.
Definition: qgswkbtypes.h:767
static bool isMultiType(Type type)
Returns true if the WKB type is a multi type.
Definition: qgswkbtypes.h:695
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:906
static Type dropM(Type type)
Drops the m dimension (if present) for a WKB type and returns the new type.
Definition: qgswkbtypes.h:1076
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:1027
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:801
static Type addZ(Type type)
Adds the z dimension to a WKB type and returns the new type.
Definition: qgswkbtypes.h:1002
static bool isSingleType(Type type)
Returns true if the WKB type is a single type.
Definition: qgswkbtypes.h:685
GeometryType
The geometry types are used to group QgsWkbTypes::Type in a coarse way.
Definition: qgswkbtypes.h:138
static Type dropZ(Type type)
Drops the z dimension (if present) for a WKB type and returns the new type.
Definition: qgswkbtypes.h:1058
static Type curveType(Type type)
Returns the curve type for a WKB type.
Definition: qgswkbtypes.h:430
static bool isCurvedType(Type type)
Returns true if the WKB type is a curved type or can contain curved geometries.
Definition: qgswkbtypes.h:744
static Type zmType(Type type, bool hasZ, bool hasM)
Returns the modified input geometry type according to hasZ / hasM.
Definition: qgswkbtypes.h:664
static bool hasM(Type type)
Tests whether a WKB type contains m values.
Definition: qgswkbtypes.h:956
static Type flatType(Type type)
Returns the flat type for a WKB type.
Definition: qgswkbtypes.h:565
static int coordDimensions(Type type)
Returns the coordinate dimension of the geometry type as an integer.
Definition: qgswkbtypes.h:788