@@ -903,6 +903,13 @@ def testDeleteVertex(self):
903
903
wkt = polyline .exportToWkt ()
904
904
assert compareWkt ( expwkt , wkt ), "Expected:\n %s\n Got:\n %s\n " % (expwkt , wkt )
905
905
906
+ polyline = QgsGeometry .fromWkt ("MULTILINESTRING((0 0, 1 0, 1 1, 2 1,2 0),(3 0, 3 1, 5 1, 5 0, 6 0))" )
907
+ for i in range (5 ):
908
+ assert polyline .deleteVertex (5 ), "Delete vertex 5 failed"
909
+ expwkt = "MULTILINESTRING((0 0, 1 0, 1 1, 2 1, 2 0))"
910
+ wkt = polyline .exportToWkt ()
911
+ assert compareWkt ( expwkt , wkt ), "Expected:\n %s\n Got:\n %s\n " % (expwkt , wkt )
912
+
906
913
# 5---4
907
914
# | |
908
915
# | 2-3
@@ -950,6 +957,14 @@ def testDeleteVertex(self):
950
957
wkt = polygon .exportToWkt ()
951
958
assert compareWkt ( expwkt , wkt ), "Expected:\n %s\n Got:\n %s\n " % (expwkt , wkt )
952
959
960
+ polygon = QgsGeometry .fromWkt ( "MULTIPOLYGON(((0 0,1 0,1 1,2 1,2 2,0 2,0 0)),((4 0,5 0,5 2,3 2,3 1,4 1,4 0)))" )
961
+ for i in range (6 ):
962
+ assert polygon .deleteVertex ( 0 ), "Delete vertex 0 failed"
963
+
964
+ expwkt = "MULTIPOLYGON(((4 0,5 0,5 2,3 2,3 1,4 1,4 0)))"
965
+ wkt = polygon .exportToWkt ()
966
+ assert compareWkt ( expwkt , wkt ), "Expected:\n %s\n Got:\n %s\n " % (expwkt , wkt )
967
+
953
968
# 3-+-+-+-+-+-+-+-+-2
954
969
# | |
955
970
# + 8-7 3-2 8-7 3-2 +
0 commit comments