26 const QMap<QgsWkbTypes::Type, QgsWkbTypes::wkbEntry> QgsWkbTypes::ENTRIES
29 { Unknown, wkbEntry( QStringLiteral(
"Unknown" ),
false, Unknown, Unknown, Unknown, UnknownGeometry,
false,
false ) },
30 { NoGeometry, wkbEntry( QStringLiteral(
"NoGeometry" ),
false, NoGeometry, NoGeometry, NoGeometry, NullGeometry,
false,
false ) },
32 { Point, wkbEntry( QStringLiteral(
"Point" ),
false, MultiPoint, Point, Point, PointGeometry,
false,
false ) },
33 { PointZ, wkbEntry( QStringLiteral(
"PointZ" ),
false, MultiPointZ, PointZ, Point, PointGeometry,
true,
false ) },
34 { PointM, wkbEntry( QStringLiteral(
"PointM" ),
false, MultiPointM, PointM, Point, PointGeometry,
false,
true ) },
35 { PointZM, wkbEntry( QStringLiteral(
"PointZM" ),
false, MultiPointZM, PointZM, Point, PointGeometry,
true,
true ) },
36 { Point25D, wkbEntry( QStringLiteral(
"Point25D" ),
false, MultiPoint25D, Point25D, Point, PointGeometry,
true,
false ) },
38 { LineString, wkbEntry( QStringLiteral(
"LineString" ),
false, MultiLineString, LineString, LineString, LineGeometry,
false,
false ) },
39 { LineStringZ, wkbEntry( QStringLiteral(
"LineStringZ" ),
false, MultiLineStringZ, LineStringZ, LineString, LineGeometry,
true,
false ) },
40 { LineStringM, wkbEntry( QStringLiteral(
"LineStringM" ),
false, MultiLineStringM, LineStringM, LineString, LineGeometry,
false,
true ) },
41 { LineStringZM, wkbEntry( QStringLiteral(
"LineStringZM" ),
false, MultiLineStringZM, LineStringZM, LineString, LineGeometry,
true,
true ) },
42 { LineString25D, wkbEntry( QStringLiteral(
"LineString25D" ),
false, MultiLineString25D, LineString25D, LineString, LineGeometry,
true,
false ) },
44 { CircularString, wkbEntry( QStringLiteral(
"CircularString" ),
false, MultiCurve, CircularString, CircularString, LineGeometry,
false,
false ) },
45 { CircularStringZ, wkbEntry( QStringLiteral(
"CircularStringZ" ),
false, MultiCurveZ, CircularStringZ, CircularString, LineGeometry,
true,
false ) },
46 { CircularStringM, wkbEntry( QStringLiteral(
"CircularStringM" ),
false, MultiCurveM, CircularStringM, CircularString, LineGeometry,
false,
true ) },
47 { CircularStringZM, wkbEntry( QStringLiteral(
"CircularStringZM" ),
false, MultiCurveZM, CircularStringZM, CircularString, LineGeometry,
true,
true ) },
49 { CompoundCurve, wkbEntry( QStringLiteral(
"CompoundCurve" ),
false, MultiCurve, CompoundCurve, CompoundCurve, LineGeometry,
false,
false ) },
50 { CompoundCurveZ, wkbEntry( QStringLiteral(
"CompoundCurveZ" ),
false, MultiCurveZ, CompoundCurveZ, CompoundCurve, LineGeometry,
true,
false ) },
51 { CompoundCurveM, wkbEntry( QStringLiteral(
"CompoundCurveM" ),
false, MultiCurveM, CompoundCurveM, CompoundCurve, LineGeometry,
false,
true ) },
52 { CompoundCurveZM, wkbEntry( QStringLiteral(
"CompoundCurveZM" ),
false, MultiCurveZM, CompoundCurveZM, CompoundCurve, LineGeometry,
true,
true ) },
54 { Polygon, wkbEntry( QStringLiteral(
"Polygon" ),
false, MultiPolygon, Polygon, Polygon, PolygonGeometry,
false,
false ) },
55 { PolygonZ, wkbEntry( QStringLiteral(
"PolygonZ" ),
false, MultiPolygonZ, PolygonZ, Polygon, PolygonGeometry,
true,
false ) },
56 { PolygonM, wkbEntry( QStringLiteral(
"PolygonM" ),
false, MultiPolygonM, PolygonM, Polygon, PolygonGeometry,
false,
true ) },
57 { PolygonZM, wkbEntry( QStringLiteral(
"PolygonZM" ),
false, MultiPolygonZM, PolygonZM, Polygon, PolygonGeometry,
true,
true ) },
58 { Polygon25D, wkbEntry( QStringLiteral(
"Polygon25D" ),
false, MultiPolygon25D, Polygon25D, Polygon, PolygonGeometry,
true,
false ) },
60 { Triangle, wkbEntry( QStringLiteral(
"Triangle" ),
false, Unknown, Triangle, Triangle, PolygonGeometry,
false,
false ) },
61 { TriangleZ, wkbEntry( QStringLiteral(
"TriangleZ" ),
false, Unknown, TriangleZ, Triangle, PolygonGeometry,
true,
false ) },
62 { TriangleM, wkbEntry( QStringLiteral(
"TriangleM" ),
false, Unknown, TriangleM, Triangle, PolygonGeometry,
false,
true ) },
63 { TriangleZM, wkbEntry( QStringLiteral(
"TriangleZM" ),
false, Unknown, TriangleZM, Triangle, PolygonGeometry,
true,
true ) },
65 { CurvePolygon, wkbEntry( QStringLiteral(
"CurvePolygon" ),
false, MultiSurface, CurvePolygon, CurvePolygon, PolygonGeometry,
false,
false ) },
66 { CurvePolygonZ, wkbEntry( QStringLiteral(
"CurvePolygonZ" ),
false, MultiSurfaceZ, CurvePolygonZ, CurvePolygon, PolygonGeometry,
true,
false ) },
67 { CurvePolygonM, wkbEntry( QStringLiteral(
"CurvePolygonM" ),
false, MultiSurfaceM, CurvePolygonM, CurvePolygon, PolygonGeometry,
false,
true ) },
68 { CurvePolygonZM, wkbEntry( QStringLiteral(
"CurvePolygonZM" ),
false, MultiSurfaceZM, CurvePolygonZM, CurvePolygon, PolygonGeometry,
true,
true ) },
70 { MultiPoint, wkbEntry( QStringLiteral(
"MultiPoint" ),
true, MultiPoint, Point, MultiPoint, PointGeometry,
false,
false ) },
71 { MultiPointZ, wkbEntry( QStringLiteral(
"MultiPointZ" ),
true, MultiPointZ, PointZ, MultiPoint, PointGeometry,
true,
false ) },
72 { MultiPointM, wkbEntry( QStringLiteral(
"MultiPointM" ),
true, MultiPointM, PointM, MultiPoint, PointGeometry,
false,
true ) },
73 { MultiPointZM, wkbEntry( QStringLiteral(
"MultiPointZM" ),
true, MultiPointZM, PointZM, MultiPoint, PointGeometry,
true,
true ) },
74 { MultiPoint25D, wkbEntry( QStringLiteral(
"MultiPoint25D" ),
true, MultiPoint25D, Point25D, MultiPoint, PointGeometry,
true,
false ) },
76 { MultiLineString, wkbEntry( QStringLiteral(
"MultiLineString" ),
true, MultiLineString, LineString, MultiLineString, LineGeometry,
false,
false ) },
77 { MultiLineStringZ, wkbEntry( QStringLiteral(
"MultiLineStringZ" ),
true, MultiLineStringZ, LineStringZ, MultiLineString, LineGeometry,
true,
false ) },
78 { MultiLineStringM, wkbEntry( QStringLiteral(
"MultiLineStringM" ),
true, MultiLineStringM, LineStringM, MultiLineString, LineGeometry,
false,
true ) },
79 { MultiLineStringZM, wkbEntry( QStringLiteral(
"MultiLineStringZM" ),
true, MultiLineStringZM, LineStringZM, MultiLineString, LineGeometry,
true,
true ) },
80 { MultiLineString25D, wkbEntry( QStringLiteral(
"MultiLineString25D" ),
true, MultiLineString25D, LineString25D, MultiLineString, LineGeometry,
true,
false ) },
82 { MultiCurve, wkbEntry( QStringLiteral(
"MultiCurve" ),
true, MultiCurve, CompoundCurve, MultiCurve, LineGeometry,
false,
false ) },
83 { MultiCurveZ, wkbEntry( QStringLiteral(
"MultiCurveZ" ),
true, MultiCurveZ, CompoundCurveZ, MultiCurve, LineGeometry,
true,
false ) },
84 { MultiCurveM, wkbEntry( QStringLiteral(
"MultiCurveM" ),
true, MultiCurveM, CompoundCurveM, MultiCurve, LineGeometry,
false,
true ) },
85 { MultiCurveZM, wkbEntry( QStringLiteral(
"MultiCurveZM" ),
true, MultiCurveZM, CompoundCurveZM, MultiCurve, LineGeometry,
true,
true ) },
87 { MultiPolygon, wkbEntry( QStringLiteral(
"MultiPolygon" ),
true, MultiPolygon, Polygon, MultiPolygon, PolygonGeometry,
false,
false ) },
88 { MultiPolygonZ, wkbEntry( QStringLiteral(
"MultiPolygonZ" ),
true, MultiPolygonZ, PolygonZ, MultiPolygon, PolygonGeometry,
true,
false ) },
89 { MultiPolygonM, wkbEntry( QStringLiteral(
"MultiPolygonM" ),
true, MultiPolygonM, PolygonM, MultiPolygon, PolygonGeometry,
false,
true ) },
90 { MultiPolygonZM, wkbEntry( QStringLiteral(
"MultiPolygonZM" ),
true, MultiPolygonZM, PolygonZM, MultiPolygon, PolygonGeometry,
true,
true ) },
91 { MultiPolygon25D, wkbEntry( QStringLiteral(
"MultiPolygon25D" ),
true, MultiPolygon25D, Polygon25D, MultiPolygon, PolygonGeometry,
true,
false ) },
93 { MultiSurface, wkbEntry( QStringLiteral(
"MultiSurface" ),
true, MultiSurface, CurvePolygon, MultiSurface, PolygonGeometry,
false,
false ) },
94 { MultiSurfaceZ, wkbEntry( QStringLiteral(
"MultiSurfaceZ" ),
true, MultiSurfaceZ, CurvePolygonZ, MultiSurface, PolygonGeometry,
true,
false ) },
95 { MultiSurfaceM, wkbEntry( QStringLiteral(
"MultiSurfaceM" ),
true, MultiSurfaceM, CurvePolygonM, MultiSurface, PolygonGeometry,
false,
true ) },
96 { MultiSurfaceZM, wkbEntry( QStringLiteral(
"MultiSurfaceZM" ),
true, MultiSurfaceZM, CurvePolygonZM, MultiSurface, PolygonGeometry,
true,
true ) },
98 { GeometryCollection, wkbEntry( QStringLiteral(
"GeometryCollection" ),
true, GeometryCollection, Unknown, GeometryCollection, UnknownGeometry,
false,
false ) },
99 { GeometryCollectionZ, wkbEntry( QStringLiteral(
"GeometryCollectionZ" ),
true, GeometryCollectionZ, Unknown, GeometryCollection, UnknownGeometry,
true,
false ) },
100 { GeometryCollectionM, wkbEntry( QStringLiteral(
"GeometryCollectionM" ),
true, GeometryCollectionM, Unknown, GeometryCollection, UnknownGeometry,
false,
true ) },
101 { GeometryCollectionZM, wkbEntry( QStringLiteral(
"GeometryCollectionZM" ),
true, GeometryCollectionZM, Unknown, GeometryCollection, UnknownGeometry,
true,
true ) },
106 QString typestr = wktStr.left( wktStr.indexOf(
'(' ) ).simplified().remove(
' ' );
108 QMap<QgsWkbTypes::Type, QgsWkbTypes::wkbEntry>::const_iterator it = ENTRIES.constBegin();
109 for ( ; it != ENTRIES.constEnd(); ++it )
111 if ( it.value().mName.compare( typestr, Qt::CaseInsensitive ) == 0 )
121 QMap< Type, wkbEntry >::const_iterator it = ENTRIES.constFind( type );
122 if ( it == ENTRIES.constEnd() )
135 return QStringLiteral(
"Point" );
137 return QStringLiteral(
"Line" );
139 return QStringLiteral(
"Polygon" );
141 return QStringLiteral(
"Unknown geometry" );
143 return QStringLiteral(
"No geometry" );
145 return QStringLiteral(
"Invalid type" );
static Type parseType(const QString &wktStr)
Attempts to extract the WKB type from a WKT string.
Type
The WKB type describes the number of dimensions a geometry has.
static QString geometryDisplayString(GeometryType type)
Returns a display string for a geometry type.
GeometryType
The geometry types are used to group QgsWkbTypes::Type in a coarse way.
static QString displayString(Type type)
Returns a display string type for a WKB type, e.g., the geometry name used in WKT geometry representa...