@@ -1706,13 +1706,13 @@ def testRegression13274(self):
17061706 def testReshape (self ):
17071707 """ Test geometry reshaping """
17081708 g = QgsGeometry .fromWkt ('Polygon ((0 0, 1 0, 1 1, 0 1, 0 0))' )
1709- g .reshapeGeometry ([ QgsPointXY (0 , 1.5 ), QgsPointXY (1.5 , 0 )])
1709+ g .reshapeGeometry (QgsLineString ([ QgsPoint (0 , 1.5 ), QgsPoint (1.5 , 0 )]) )
17101710 expWkt = 'Polygon ((0.5 1, 0 1, 0 0, 1 0, 1 0.5, 0.5 1))'
17111711 wkt = g .exportToWkt ()
17121712 assert compareWkt (expWkt , wkt ), "testReshape failed: mismatch Expected:\n %s\n Got:\n %s\n " % (expWkt , wkt )
17131713
17141714 # Test reshape a geometry involving the first/last vertex (https://issues.qgis.org/issues/14443)
1715- g .reshapeGeometry ([ QgsPointXY (0.5 , 1 ), QgsPointXY (0 , 0.5 )])
1715+ g .reshapeGeometry (QgsLineString ([ QgsPoint (0.5 , 1 ), QgsPoint (0 , 0.5 )]) )
17161716
17171717 expWkt = 'Polygon ((0 0.5, 0 0, 1 0, 1 0.5, 0.5 1, 0 0.5))'
17181718 wkt = g .exportToWkt ()
@@ -1721,24 +1721,24 @@ def testReshape(self):
17211721 # Test reshape a line from first/last vertex
17221722 g = QgsGeometry .fromWkt ('LineString (0 0, 5 0, 5 1)' )
17231723 # extend start
1724- self .assertEqual (g .reshapeGeometry ([ QgsPointXY (0 , 0 ), QgsPointXY (- 1 , 0 )]), 0 )
1724+ self .assertEqual (g .reshapeGeometry (QgsLineString ([ QgsPoint (0 , 0 ), QgsPoint (- 1 , 0 )]) ), 0 )
17251725 expWkt = 'LineString (-1 0, 0 0, 5 0, 5 1)'
17261726 wkt = g .exportToWkt ()
17271727 assert compareWkt (expWkt , wkt ), "testReshape failed: mismatch Expected:\n %s\n Got:\n %s\n " % (expWkt , wkt )
17281728 # extend end
1729- self .assertEqual (g .reshapeGeometry ([ QgsPointXY (5 , 1 ), QgsPointXY (10 , 1 ), QgsPointXY (10 , 2 )]), 0 )
1729+ self .assertEqual (g .reshapeGeometry (QgsLineString ([ QgsPoint (5 , 1 ), QgsPoint (10 , 1 ), QgsPoint (10 , 2 )]) ), 0 )
17301730 expWkt = 'LineString (-1 0, 0 0, 5 0, 5 1, 10 1, 10 2)'
17311731 wkt = g .exportToWkt ()
17321732 assert compareWkt (expWkt , wkt ), "testReshape failed: mismatch Expected:\n %s\n Got:\n %s\n " % (expWkt , wkt )
17331733 # test with reversed lines
17341734 g = QgsGeometry .fromWkt ('LineString (0 0, 5 0, 5 1)' )
17351735 # extend start
1736- self .assertEqual (g .reshapeGeometry ([ QgsPointXY (- 1 , 0 ), QgsPointXY (0 , 0 )]), 0 )
1736+ self .assertEqual (g .reshapeGeometry (QgsLineString ([ QgsPoint (- 1 , 0 ), QgsPoint (0 , 0 )]) ), 0 )
17371737 expWkt = 'LineString (-1 0, 0 0, 5 0, 5 1)'
17381738 wkt = g .exportToWkt ()
17391739 assert compareWkt (expWkt , wkt ), "testReshape failed: mismatch Expected:\n %s\n Got:\n %s\n " % (expWkt , wkt )
17401740 # extend end
1741- self .assertEqual (g .reshapeGeometry ([ QgsPointXY (10 , 2 ), QgsPointXY (10 , 1 ), QgsPointXY (5 , 1 )]), 0 )
1741+ self .assertEqual (g .reshapeGeometry (QgsLineString ([ QgsPoint (10 , 2 ), QgsPoint (10 , 1 ), QgsPoint (5 , 1 )]) ), 0 )
17421742 expWkt = 'LineString (-1 0, 0 0, 5 0, 5 1, 10 1, 10 2)'
17431743 wkt = g .exportToWkt ()
17441744 assert compareWkt (expWkt , wkt ), "testReshape failed: mismatch Expected:\n %s\n Got:\n %s\n " % (expWkt , wkt )
0 commit comments