@@ -357,7 +357,11 @@ def test_geometryTypes(self):
357
357
(3 , "POLYGON" , "((0 0,1 0,1 1,0 0))" ),
358
358
(4 , "MULTIPOINT" , "((1 1))" ),
359
359
(5 , "MULTILINESTRING" , "((0 0,1 0),(0 1,1 1))" ),
360
- (6 , "MULTIPOLYGON" , "(((0 0,1 0,1 1,0 0)),((2 2,3 0,3 3,2 2)))" )]
360
+ (6 , "MULTIPOLYGON" , "(((0 0,1 0,1 1,0 0)),((2 2,3 0,3 3,2 2)))" ),
361
+ (9 , "COMPOUNDCURVE" , "(CIRCULARSTRING(0 0, 1 0, 1 1))" ),
362
+ (10 , "CURVEPOLYGON" , "(COMPOUNDCURVE(CIRCULARSTRING(0 0, 1 0, 1 1)))" ),
363
+ (11 , "MULTICURVE" , "(COMPOUNDCURVE(CIRCULARSTRING(0 0, 1 0, 1 1)),COMPOUNDCURVE(CIRCULARSTRING(2 2, 3 2, 3 3)))" ),
364
+ (12 , "MULTISURFACE" , "(CURVEPOLYGON(COMPOUNDCURVE(CIRCULARSTRING(0 0, 1 0, 1 1))),CURVEPOLYGON(COMPOUNDCURVE(CIRCULARSTRING(2 2, 3 2, 3 3))))" )]
361
365
for wkb_type , wkt_type , wkt in geo :
362
366
l = QgsVectorLayer ("%s?crs=epsg:4326" % wkt_type , "m1" , "memory" , QgsVectorLayer .LayerOptions (False ))
363
367
self .assertEqual (l .isValid (), True )
@@ -372,7 +376,13 @@ def test_geometryTypes(self):
372
376
l2 = QgsVectorLayer ("?layer_ref=%s" % l .id (), "vtab" , "virtual" , QgsVectorLayer .LayerOptions (False ))
373
377
self .assertEqual (l2 .isValid (), True )
374
378
self .assertEqual (l2 .dataProvider ().featureCount (), 1 )
375
- self .assertEqual (l2 .dataProvider ().wkbType (), wkb_type )
379
+ # we ensure the geom type matches the original (semgentized) type
380
+ self .assertEqual (l2 .dataProvider ().wkbType (), QgsWkbTypes .linearType (wkb_type ))
381
+
382
+ # we ensure the geometry still matches the original (segmentized) geometry
383
+ f2 = QgsFeature ()
384
+ l2 .getFeatures ().nextFeature (f2 )
385
+ self .assertEqual (f2 .geometry ().asWkt (), f1 .geometry ().constGet ().segmentize ().asWkt ())
376
386
377
387
QgsProject .instance ().removeMapLayer (l .id ())
378
388
0 commit comments