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