82 const QString trimmed = text.trimmed();
83 std::unique_ptr< QgsAbstractGeometry> geom;
84 if ( trimmed.startsWith(
"Point"_L1, Qt::CaseInsensitive ) )
86 geom = std::make_unique< QgsPoint >();
88 else if ( trimmed.startsWith(
"LineString"_L1, Qt::CaseInsensitive ) )
90 geom = std::make_unique< QgsLineString >();
92 else if ( trimmed.startsWith(
"CircularString"_L1, Qt::CaseInsensitive ) )
94 geom = std::make_unique< QgsCircularString >();
96 else if ( trimmed.startsWith(
"CompoundCurve"_L1, Qt::CaseInsensitive ) )
98 geom = std::make_unique< QgsCompoundCurve>();
100 else if ( trimmed.startsWith(
"Polygon"_L1, Qt::CaseInsensitive ) )
102 geom = std::make_unique< QgsPolygon >();
104 else if ( trimmed.startsWith(
"Triangle"_L1, Qt::CaseInsensitive ) )
106 geom = std::make_unique< QgsTriangle >();
108 else if ( trimmed.startsWith(
"CurvePolygon"_L1, Qt::CaseInsensitive ) )
110 geom = std::make_unique< QgsCurvePolygon >();
112 else if ( trimmed.startsWith(
"MultiPoint"_L1, Qt::CaseInsensitive ) )
114 geom = std::make_unique< QgsMultiPoint >();
116 else if ( trimmed.startsWith(
"MultiCurve"_L1, Qt::CaseInsensitive ) )
118 geom = std::make_unique< QgsMultiCurve >();
120 else if ( trimmed.startsWith(
"MultiLineString"_L1, Qt::CaseInsensitive ) )
122 geom = std::make_unique< QgsMultiLineString >();
124 else if ( trimmed.startsWith(
"MultiSurface"_L1, Qt::CaseInsensitive ) )
126 geom = std::make_unique< QgsMultiSurface >();
128 else if ( trimmed.startsWith(
"MultiPolygon"_L1, Qt::CaseInsensitive ) )
130 geom = std::make_unique< QgsMultiPolygon >();
132 else if ( trimmed.startsWith(
"GeometryCollection"_L1, Qt::CaseInsensitive ) )
134 geom = std::make_unique< QgsGeometryCollection >();
136 else if ( trimmed.startsWith(
"PolyhedralSurface"_L1, Qt::CaseInsensitive ) )
138 geom = std::make_unique< QgsPolyhedralSurface >();
140 else if ( trimmed.startsWith(
"TIN"_L1, Qt::CaseInsensitive ) )
142 geom = std::make_unique< QgsTriangulatedSurface >();
144 else if ( trimmed.startsWith(
"NurbsCurve"_L1, Qt::CaseInsensitive ) )
146 geom = std::make_unique< QgsNurbsCurve >();
151 if ( !geom->fromWkt( text ) )
195 auto poly = std::make_unique< QgsPolygon >();
197 QVector<QgsCurve *> holes;
198 holes.reserve( polygon.size() );
199 for (
int i = 0; i < polygon.size(); ++i )
201 std::unique_ptr< QgsLineString > l = linestringFromPolyline( polygon.at( i ) );
206 poly->setExteriorRing( l.release() );
210 holes.push_back( l.release() );
213 poly->setInteriorRings( holes );
254 return std::make_unique< QgsPoint >();
256 return std::make_unique< QgsLineString >();
258 return std::make_unique< QgsCircularString >();
260 return std::make_unique< QgsCompoundCurve >();
262 return std::make_unique< QgsPolygon >();
264 return std::make_unique< QgsCurvePolygon >();
266 return std::make_unique< QgsMultiLineString >();
268 return std::make_unique< QgsMultiPolygon >();
270 return std::make_unique< QgsMultiPoint >();
272 return std::make_unique< QgsMultiCurve >();
274 return std::make_unique< QgsMultiSurface >();
276 return std::make_unique< QgsGeometryCollection >();
278 return std::make_unique< QgsTriangle >();
280 return std::make_unique< QgsPolyhedralSurface >();
282 return std::make_unique< QgsTriangulatedSurface >();
284 return std::make_unique< QgsNurbsCurve >();